Skip to content

Commit

Permalink
Adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Filienko committed Aug 14, 2024
1 parent 5ab9af3 commit 0980c66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_validate_jwt(self, mock_decode, mock_jwk_client):
print(f'Response Data: {response.data.decode()}')
print(f'Response JSON: {response.json}')
self.assertEqual(response.status_code, 400)
self.assertEqual(response.json['message'], "token missing")
self.assertEqual(response.json.get('message'), "token missing")

# Test expired token
mock_decode.side_effect = jwt.exceptions.ExpiredSignatureError()
Expand All @@ -87,7 +87,7 @@ def test_validate_jwt(self, mock_decode, mock_jwk_client):
print(f'Response Data: {response.data.decode()}')
print(f'Response JSON: {response.json}')
self.assertEqual(response.status_code, 401)
self.assertEqual(response.json['message'], "token expired")
self.assertEqual(response.json.get('message'), "token expired")

def test_smart_configuration(self):
"""Test /fhir/.well-known/smart-configuration endpoint"""
Expand Down
2 changes: 2 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class TestConfig:
TESTING = True


class TestIsaccJWTProxyApp(unittest.TestCase):
def setUp(self):
self.app = create_app(testing=True)
Expand All @@ -17,5 +18,6 @@ def test_app_exists(self):
def test_blueprints_registered(self):
self.assertIn('auth', self.app.blueprints)


if __name__ == '__main__':
unittest.main()

0 comments on commit 0980c66

Please sign in to comment.