Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyagreco committed Sep 21, 2024
1 parent 49dfaba commit c9cba63
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions sleeper/api/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from sleeper.api._utils import build_route, get


def get_user(*, user_identifier: str) -> dict:
# user_identifier can be username or user_id
url = build_route(SLEEPER_APP_BASE_URL, VERSION, USER_ROUTE, f"{user_identifier}")
def get_user(*, identifier: str) -> dict:
# identifier can be username or user id
url = build_route(SLEEPER_APP_BASE_URL, VERSION, USER_ROUTE, f"{identifier}")
return get(url)
4 changes: 2 additions & 2 deletions test/integration/test_api/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

class TestUser(unittest.TestCase):
def test_get_user_with_user_id_as_identifier(self):
response = get_user(user_identifier=USER_B_USER_ID)
response = get_user(identifier=USER_B_USER_ID)
self.assertEqual(response, USER_B_USER)

def test_get_user_with_username_as_identifier(self):
response = get_user(user_identifier=USER_B_USERNAME)
response = get_user(identifier=USER_B_USERNAME)
self.assertEqual(response, USER_B_USER)
2 changes: 1 addition & 1 deletion test/unit/test_api/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_get_user(self, mock_requests_get):
mock_response = MockResponse(mock_dict, 200)
mock_requests_get.return_value = mock_response

response = get_user(user_identifier="foo")
response = get_user(identifier="foo")

self.assertEqual(mock_dict, response)
mock_requests_get.assert_called_once_with("https://api.sleeper.app/v1/user/foo")

0 comments on commit c9cba63

Please sign in to comment.