Skip to content
This repository has been archived by the owner on Jan 7, 2024. It is now read-only.

Commit

Permalink
Add API proxy test (no cassette yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
eloquence committed Oct 9, 2020
1 parent 5c6c7e2 commit 9c392d4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_apiproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,20 @@ def test_get_current_user(self):
self.assertTrue("first_name" in user)
self.assertTrue("last_name" in user)

@dastollervey_datasaver
def test_get_users(self):
users = self.api.get_users()
for user in users:
# Assert expected fields are present
assert hasattr(user, "first_name")
assert hasattr(user, "last_name")
# Every user has a non-empty name and UUID
assert user.username
assert user.uuid
# The API should never return these fields
assert not hasattr(user, "last_login")
assert not hasattr(user, "is_admin")

@dastollervey_datasaver
def test_error_unencrypted_reply(self):
s = self.api.get_sources()[0]
Expand Down

0 comments on commit 9c392d4

Please sign in to comment.