Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipeline #146

Open
wants to merge 78 commits into
base: backup_master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
3cfbe97
codebase linting and quality controls
niall-byrne Nov 13, 2019
d11b6d5
testing: Update pytest coverage package
niall-byrne Nov 14, 2019
3b9b9f3
Create pythonpackage.yml
niall-byrne Nov 14, 2019
6845a74
Add build pipeline.
niall-byrne Nov 14, 2019
80dd104
Merge branch 'niall-byrne-patch-1' into pipeline
niall-byrne Nov 14, 2019
6380de9
testing: Add unittest for makeclass
niall-byrne Nov 18, 2019
662c8e1
add test cases for extract_swagger_path
Seonaid Nov 18, 2019
e8c2ca9
add test to extract_swagger_path
Seonaid Nov 18, 2019
c7ba089
refactor extract_swagger_path tests
Seonaid Nov 18, 2019
9f86b63
Added sanitize_doc unit test
AshrafPatel Nov 18, 2019
1c60c6b
Testing: added test for swagger function extract_path_arguments
slafi-vw Nov 18, 2019
adbe846
mock render_page call to test render_endpoint
Seonaid Nov 18, 2019
7dcc6db
Testing: added test for swagger function extract_path_arguments
slafi-vw Nov 18, 2019
d3730fb
testing: added test for model(...)
Nov 18, 2019
acab4b8
Added test_render_homepage.py
AshrafPatel Nov 18, 2019
eca24de
testing: Add test for operation(...)
Nov 18, 2019
d708ab0
test __parse_docs_ green
Seonaid Nov 18, 2019
cd8b2c3
linting: Apply linter to pipelines branch
niall-byrne Nov 19, 2019
d2efca4
Merge remote-tracking branch 'original/pipeline' into pipeline
Nov 19, 2019
fb2d2c5
Merge remote-tracking branch 'parent/pipeline' into pipeline
Seonaid Nov 19, 2019
794c6e0
testing: Run linting tools on test_model and test_operation
Nov 19, 2019
40005cb
linting the files
Seonaid Nov 19, 2019
300040c
testing: Fix unused import on test_operation
Nov 19, 2019
6f375c7
Merge pull request #132 from dlieu/pipeline
niall-byrne Nov 19, 2019
ef9a130
Merge pull request #130 from Seonaid/pipeline
niall-byrne Nov 19, 2019
1f72742
Merge remote-tracking branch 'original/pipeline' into pipeline
slafi-vw Nov 19, 2019
4c155eb
Testing: added test for swagger function extract_path_arguments
slafi-vw Nov 18, 2019
23a1116
testing for deduce_swagger_type_flat included bug fix discovered in t…
Seonaid Nov 19, 2019
f796969
testing: coverage for staticfiles
niall-byrne Nov 19, 2019
b93cf34
Merge pull request #133 from niall-byrne/local
niall-byrne Nov 19, 2019
c11bba6
test deduce_swaagger_type
Seonaid Nov 19, 2019
b57ceaf
testing: Add test for ResourceLister
niall-byrne Nov 19, 2019
eb5a753
Merge pull request #134 from niall-byrne/local
niall-byrne Nov 19, 2019
4acfa98
test render page
Seonaid Nov 19, 2019
41675ee
Testing: nested and extract_path_arguments
slafi-vw Nov 19, 2019
53aa2d7
Testing: nested and extract_path_arguments
slafi-vw Nov 19, 2019
e6cf2a7
linting
Seonaid Nov 19, 2019
905ad4a
Merge pull request #136 from Seonaid/pipeline
niall-byrne Nov 22, 2019
d353968
tests: clean up some formatting, ensure system compatibillity
niall-byrne Nov 22, 2019
3f1d470
scripts: ensure coverage data in regenerated on each test run
niall-byrne Nov 22, 2019
4f1e88c
testing: Fix python2 compatibillity
niall-byrne Nov 22, 2019
69979ec
testing: Fix python2 compatibillity
niall-byrne Nov 22, 2019
f3750c7
Merge pull request #131 from AshrafPatel/ashraf_test
niall-byrne Nov 23, 2019
b97f1c8
Merge remote-tracking branch 'rantav/pipeline' into pipeline
niall-byrne Nov 23, 2019
f0891f7
Merge remote-tracking branch 'rantav/pipeline' into pipeline
niall-byrne Nov 23, 2019
bd71db5
tests: refactor duplicated test cases
niall-byrne Nov 23, 2019
55c4a87
WIP: testing swagger endpoint
niall-byrne Nov 23, 2019
79f0a4a
testing: validate html generated by swagger endpoint
niall-byrne Nov 27, 2019
074e45e
testing: add coverage for extract_path_parameters
niall-byrne Nov 27, 2019
3ae3ace
Merge pull request #135 from slafi/local
niall-byrne Nov 27, 2019
30cf491
testing: Fix nested function extraction, clean up tests.
niall-byrne Nov 27, 2019
98e1fe2
testing: swagger endpoint class
niall-byrne Nov 27, 2019
71f717b
Testing: Add test_add_model
Nov 19, 2019
79e8021
testing: coverage for get_current_registry
niall-byrne Nov 28, 2019
cb0a21a
testing: WIP doc method
niall-byrne Nov 28, 2019
845eddd
testing: Add coverage for docs function
niall-byrne Nov 28, 2019
2226c92
testing: coverage for register_once
niall-byrne Nov 28, 2019
6ac8e08
testing: exclude python3 import compatibillity from coverage
niall-byrne Nov 28, 2019
0bd2125
completed test_add_model
Dec 12, 2019
d5a51dc
support python2 imports
Jan 28, 2020
1122380
seperate test fixture objects into another file
Jan 29, 2020
c066f2e
rename from TodoItem to MockTodoItem
Jan 29, 2020
06c5dac
Add Mock in front of naming for: ModelWithResourceFieldsNoRequired
Jan 29, 2020
24f9f92
refactor fixtures into seperate file
Jan 29, 2020
587e5e9
refactor patching data structures into seperate file. use context man…
Jan 29, 2020
f8df19b
refactor(DEVELOPMENT): modernize the development tool chain, and add …
niall-byrne Feb 10, 2020
1bc43e2
test(PYTHON2): add a test case to conclude coverage, and swap black f…
niall-byrne Feb 10, 2020
1ed6de6
docs(CLI): update development environment documentation
niall-byrne Feb 10, 2020
853ff70
ci(GITHUB): fix error on dockerfile manipulation
niall-byrne Feb 10, 2020
29b7dfd
fix(STDOUT): remove diagnostic print statements
niall-byrne Feb 10, 2020
b20b568
docs(README): github action badge nit
niall-byrne Feb 10, 2020
678f54c
docs(EXAMPLES): add some instructions to quickly bring up the example…
niall-byrne Feb 10, 2020
500e191
docs(CONTRIBUTING): update contact details
niall-byrne Feb 10, 2020
cb04b62
refactor(CLEANUP): cleanup the repository root, and coverage configur…
niall-byrne Feb 10, 2020
94ae777
for init testing, make sure resource_fields code is NOT called
Jan 29, 2020
4f14f0a
community: Add contribution guidelines link, and standard code of con…
niall-byrne Jan 30, 2020
3e0e5e2
fix py2 testing issues from old-style classes
Feb 10, 2020
f43ec05
docs(CONTRIBUTION): add some guidelines for commit message and linting
niall-byrne Feb 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor patching data structures into seperate file. use context man…
…ager
  • Loading branch information
dl authored and niall-byrne committed Feb 10, 2020
commit 587e5e9fa4f55aa5b7ada78ca3b9bf1fd0b935e3
67 changes: 67 additions & 0 deletions tests/fixtures_add_model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,74 @@
try:
from unittest.mock import patch
from unittest.mock import Mock
except ImportError:
from mock import patch
from mock import Mock
from contextlib import contextmanager

from flask_restful import fields

from flask_restful_swagger import swagger


@contextmanager
def patch_registry():
with patch("flask_restful_swagger.swagger.registry") as mock_registry:
_temp_dict = {"models": {}}
mock_registry.__getitem__.side_effect = _temp_dict.__getitem__
mock_registry.__setitem__.side_effect = _temp_dict.__setitem__
yield _temp_dict


@contextmanager
def patch_parse_doc():
with patch("flask_restful_swagger.swagger._parse_doc") as mock_parse_doc:
mock_parse_doc.return_value = (None, None)
yield mock_parse_doc


@contextmanager
def patch_deduce_swagger_type():
with patch(
"flask_restful_swagger.swagger.deduce_swagger_type"
) as mock_deduce_swagger_type:
mock_deduce_swagger_type.return_value = "dummy_swagger_type"
yield mock_deduce_swagger_type


@contextmanager
def patch_isinstance(patchbool):
with patch("flask_restful_swagger.swagger.isinstance") as mock_isinstance:
mock_isinstance.return_value = patchbool
yield mock_isinstance


@contextmanager
def patch_hasattr():
with patch("flask_restful_swagger.swagger.hasattr") as mock_hasattr:
mock_hasattr.return_value = True
yield mock_hasattr


@contextmanager
def patch_dir(patchreturn):
with patch("flask_restful_swagger.swagger.dir") as mock_dir:
mock_dir.return_value = patchreturn
yield mock_dir


@contextmanager
def patch_getargspec():
with patch(
"flask_restful_swagger.swagger.inspect.getargspec"
) as mock_getargspec:
mock_argspec = Mock()
mock_argspec.args = ["self", "arg1", "arg2", "arg3"]
mock_argspec.defaults = ("123",)
mock_getargspec.return_value = mock_argspec
yield mock_getargspec


###############################################################################
# Copy setup objects from examples/basic.py
###############################################################################
Loading