Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtin committed Oct 24, 2016
1 parent b5919ad commit 1555a85
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 3 deletions.
64 changes: 64 additions & 0 deletions tests/build-matrix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
:

tmp="/tmp/c$$"
tmp="/tmp/c0"

trap "rm -f ${tmp}_*; exit" 0 1 2 15

if true
then
curl -s -S https://api.cloudflare.com/ > ${tmp}_api.html
ls -l ${tmp}_api.html 1>&2
cp ${tmp}_api.html /tmp/api.html
else
cp /tmp/api.html ${tmp}_api.html
fi

cat ${tmp}_api.html | sed -e '
s/<\/br>/&\
/g
s/<\/h[0-9]>/&\
/g' | egrep language-http |\
sed -e '
s/\/organization\//\/organizations\//
/GET \/object\/:object_id/d
s/<[^>]*>//g
s/^[ ]*//
s/\/:[a-z_]*\//\/:identifier\//g
s/\/:[a-z_]*$/\//
s/\/$//' |\
awk '
BEGIN {
methods[1] = "GET"
methods[2] = "PUT"
methods[3] = "POST"
methods[4] = "PATCH"
methods[5] = "DELETE"
}
/ / {
if (match(a[$2],$1)==0) {
a[$2] = a[$2] " " $1
}
}
END {
for (m=1;m<=5;m++) {
printf "|%-8s", "`" methods[m] "`"
}
printf "|%-8s|\n", "API Call"
for (m=1;m<=5;m++) {
printf "|%-8s", "---"
}
printf "|%-8s|\n", ":---"
for (k in a) {
for (m=1;m<=5;m++) {
if (match(a[k], methods[m])) {
printf "|%-8s", "`" methods[m] "`"
} else {
printf "|%-8s", ""
}
}
printf "|%s|\n", k
}
}
' | sort -t/ -k2,3

20 changes: 20 additions & 0 deletions tests/compare-api_v4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
:

tmp="/tmp/c$$"
tmp="/tmp/c0"

# trap "rm -f ${tmp}_*; exit" 0 1 2 15

(sed -e 's/#.*//' | egrep setattr) < ../CloudFlare/api_v4.py | egrep -v self._unused | cut -d, -f4,5,6 | sed -e 's/^ "/\//' -e 's/", "/\/:identifier\//g' -e 's/"))$//' | sort -u > ${tmp}_1
if false
then
curl -s -S https://api.cloudflare.com/ > ${tmp}_api.html
else
cp /tmp/api.html ${tmp}_api.html
fi
egrep 'language-http' < ${tmp}_api.html | sed -e 's/\/organization\//\/organizations\//' -e '/GET \/object\/:object_id/d' -e 's/<[^>]*>//g' -e 's/^[ ]*//' -e 's/\/:[a-z_]*\//\/:identifier\//g' -e 's/\/:[a-z_]*$/\//' -e 's/\/$//' | tee ${tmp}_3 | awk '{print $2}' | sort -u > ${tmp}_2

echo "< GitHUb vs > Documentation"

diff ${tmp}_1 ${tmp}_2

10 changes: 10 additions & 0 deletions tests/create-readme-rst.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python

import os
import pypandoc

long_description = pypandoc.convert('README.md', 'rst')
long_description = long_description.replace("\r","")
with open('README.rst','w') as f:
f.write(long_description)

6 changes: 3 additions & 3 deletions tests/test1.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pytest

def test_ips():
cf = CloudFlare.CloudFlare()
zones = cf.ips.get()
assert zones
cf = CloudFlare.CloudFlare()
ips = cf.ips.get()
assert ips

0 comments on commit 1555a85

Please sign in to comment.