Skip to content

Commit

Permalink
fix: HIVE-877 update unit tests
Browse files Browse the repository at this point in the history
Add mock as a development dependency and update test_user_endpoints to expect a 200 status code whenever the result list is empty.
  • Loading branch information
gregmundy committed Jul 22, 2020
1 parent af80737 commit 562ae2b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 71 deletions.
5 changes: 3 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ pycodestyle = "*"
"autopep8" = "*"
flask = "*"
flask-restful = "*"
gunicorn = {extras = ["gevent"], version = "*"}
gunicorn = {extras = ["gevent"],version = "*"}
flask-sqlalchemy = "*"
flask-migrate = "*"
"psycopg2-binary" = "*"
brighthive-authlib = "*"
requests = "*"
gevent = "*"
mci-database = {editable = true, ref = "master", git = "https://github.com/brighthive/mci-database.git"}
mci-database = {editable = true,ref = "master",git = "https://github.com/brighthive/mci-database.git"}

[dev-packages]
expects = "*"
Expand All @@ -25,6 +25,7 @@ docker = "*"
sphinx = "*"
pytest-mock = "*"
requests-mock = "*"
mock = "*"

[requires]
python_version = "3.8"
78 changes: 10 additions & 68 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/test_user_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_users_endpoint_empty(self, mocker, database, test_client):
'''
response = test_client.get('/users')

assert response.status_code == 404
assert response.status_code == 200
assert response.json['users'] == []

@mock.patch('brighthive_authlib.providers.AuthZeroProvider.validate_token', return_value=True)
Expand Down

0 comments on commit 562ae2b

Please sign in to comment.