-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
46 changed files
with
984 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[run] | ||
source = | ||
umbr_api | ||
|
||
# branch = True | ||
|
||
[report] | ||
# Regexes for lines to exclude from consideration | ||
exclude_lines = | ||
# Have to re-enable the standard pragma | ||
pragma: no cover | ||
|
||
# Don't complain about missing debug-only code: | ||
def __repr__ | ||
if self\.debug | ||
|
||
# Don't complain if non-runnable code isn't run: | ||
if __name__ == .__main__.: | ||
|
||
ignore_errors = True | ||
|
||
[paths] | ||
source = | ||
umbr_api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,8 @@ venv/ | |
*.egg-info/ | ||
dist/ | ||
docs/_build/ | ||
.coverage | ||
*.py,cover | ||
.pytest_cache/ | ||
|
||
customer_key.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
include LICENSE | ||
include README.rst | ||
include Makefile | ||
include requirements.txt | ||
include requirements_dev.txt | ||
include umbr_api/data/customer_key_example.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
.PHONY: test | ||
test: clear-all install-dev | ||
pytest -q --cache-clear tests/ | ||
|
||
.PHONY: test-online | ||
test-online: clear-all install-dev | ||
pytest -k 'Online' -q --cache-clear tests/ | ||
|
||
.PHONY: test-offline | ||
test-offline: clear-all install-dev | ||
pytest -k 'not Online' -q --cache-clear tests/ | ||
|
||
.PHONY: install-dev | ||
install-dev: | ||
pip install -q -e .[dev] | ||
|
||
.PHONY: coverage-offline | ||
coverage-offline: clear-pyc clear-cov | ||
coverage run -m pytest -k 'not Online' -q --cache-clear tests/ | ||
coverage report | ||
coverage annotate | ||
|
||
.PHONY: coverage | ||
coverage: clear-pyc clear-cov | ||
coverage run -m pytest | ||
coverage report | ||
coverage annotate | ||
|
||
.PHONY: cov | ||
cov: coverage | ||
|
||
.PHONY: upload | ||
upload: clear-all built | ||
twine upload dist/* | ||
|
||
.PHONY: docs | ||
docs: clear-pyc install-dev | ||
$(MAKE) -C docs html | ||
|
||
.PHONY: built | ||
built: | ||
python3 setup.py sdist | ||
|
||
.PHONY: clear-all | ||
clear-all: clear-pyc clear-cov clear-build | ||
|
||
.PHONY: clear-pyc | ||
clear-pyc: | ||
find . -type d -name '__pycache__' -exec rm -rf {} + | ||
find . -type f -name '*.py[co]' -exec rm -f {} + | ||
find . -type f -name '*~' -exec rm -f {} + | ||
|
||
.PHONY: clear-cov | ||
clear-cov: | ||
find . -type f -name '*.py,cover' -exec rm -f {} + | ||
rm -fr .pytest_cache | ||
coverage erase | ||
|
||
.PHONY: clear-build | ||
clear-build: | ||
rm -fr docs/_build/ | ||
rm -fr dist/ | ||
rm -fr *.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"incorrect_key_in_json": "YOUR-CUSTOMER-KEY-IS-HERE-0123456789" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"id":"6ece47ef,7afc,4a50,89e6-b0a10adc2d8a"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
202 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{'Server': 'nginx/1.10.1', 'Date': 'Sun, 04 Mar 2018 08:37:24 GMT', 'Content-Type': 'application/json', 'Content-Length': '45', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"message":"There were one or more missing or required fields","errors":{"dstDomain":"is invalid"},"statusCode":400} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
400 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{'Server': 'nginx/1.10.1', 'Date': 'Sun, 04 Mar 2018 08:51:22 GMT', 'Content-Type': 'application/json', 'Content-Length': '116', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"meta":{"page":1,"limit":10,"prev":false,"next":false},"data":[{"id":2201,"name":"example.com","lastSeenAt":1520190490},{"id":55522,"name":"www.example.com","lastSeenAt":1520188469}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{'Server': 'nginx/1.10.1', 'Date': 'Sun, 04 Mar 2018 19:09:31 GMT', 'Content-Type': 'application/json', 'Content-Length': '184', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains', 'X-Frame-Options': 'SAMEORIGIN', 'X-XSS-Protection': '1; mode=block'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"code":"BadRequestError","message":"Limit must be a number less than or equal to 200","statusCode":400} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
400 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{'Server': 'nginx/1.10.1', 'Date': 'Sun, 04 Mar 2018 18:40:50 GMT', 'Content-Type': 'application/json', 'Content-Length': '104', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
204 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{'Server': 'nginx/1.10.1', 'Date': 'Sun, 04 Mar 2018 11:03:32 GMT', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains', 'X-Frame-Options': 'SAMEORIGIN', 'X-XSS-Protection': '1; mode=block'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"code":"NotFoundError","message":"Domain not in domain list","statusCode":404} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
404 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{'Server': 'nginx/1.10.1', 'Date': 'Sun, 04 Mar 2018 11:05:29 GMT', 'Content-Type': 'application/json', 'Content-Length': '79', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env python3 | ||
# pylint: disable=R0201 | ||
"""Test unit.""" | ||
|
||
import unittest | ||
|
||
|
||
class OnlineTestCase(unittest.TestCase): | ||
"""Main class.""" | ||
|
||
# def test_default(self): | ||
# """Call get_list() with default args.""" | ||
# import umbr_api | ||
# umbr_api.add.add(domain='example.com', url='example.com', key=None) | ||
|
||
def test_main(self): | ||
"""Call main.""" | ||
from umbr_api.add import main | ||
main() | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env python3 | ||
# pylint: disable=R0201 | ||
"""Test unit.""" | ||
|
||
import unittest | ||
|
||
|
||
class OnlineTestCase(unittest.TestCase): | ||
"""Main class.""" | ||
|
||
def test_default(self): | ||
"""Call get_list() with default args.""" | ||
import umbr_api | ||
umbr_api.get.get_list() | ||
|
||
def test_main(self): | ||
"""Call main.""" | ||
import umbr_api | ||
umbr_api.get.main() | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python3 | ||
# pylint: disable=R0201 | ||
"""Test unit.""" | ||
|
||
import unittest | ||
|
||
|
||
class TestCase(unittest.TestCase): | ||
"""Main class.""" | ||
|
||
def test_send_post(self): | ||
"""Call incorrect send_post, get None.""" # import requests | ||
from umbr_api._http_requests import send_post | ||
|
||
response = send_post(' ') | ||
self.assertEqual(response, None) | ||
|
||
def test_send_get(self): | ||
"""Call incorrect send_get, get None.""" # import requests | ||
from umbr_api._http_requests import send_get | ||
|
||
response = send_get(' ') | ||
self.assertEqual(response, None) | ||
|
||
def test_send_delete(self): | ||
"""Call incorrect send_delete, get None.""" # import requests | ||
from umbr_api._http_requests import send_delete | ||
|
||
response = send_delete(' ') | ||
self.assertEqual(response, None) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
Oops, something went wrong.