Skip to content

Commit

Permalink
Add login test
Browse files Browse the repository at this point in the history
  • Loading branch information
Reillyhewitson committed Nov 14, 2022
1 parent 652d1db commit e3e2005
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/datagateway_api/db/test_requires_session_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ class TestRequiresSessionID:
decorator for the Python ICAT backend is tested in `test_session_handling.py`
"""

def test_login(self, flask_test_app_db):
test_response = flask_test_app_db.post(
f"{Config.config.datagateway_api.extension}/sessions",
json={"username": "user", "password": "password", "mechanism": "simple"},
)
print(dir(test_response.response))
assert test_response.status_code == 201

def test_invalid_missing_credentials(self, flask_test_app_db):
test_response = flask_test_app_db.get(
f"{Config.config.datagateway_api.extension}/datafiles",
Expand Down

0 comments on commit e3e2005

Please sign in to comment.