Skip to content

Commit

Permalink
Remove parameter to login.post_response_ok, unused.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Mar 24, 2024
1 parent 5efdcdd commit 0ce47bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
4 changes: 2 additions & 2 deletions tests/mock/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from . import AUTH_TOKEN, panel, user


def post_response_ok(auth_token=AUTH_TOKEN, user_response=user.get_response_ok()):
def post_response_ok(auth_token=AUTH_TOKEN):
"""Return the successful login response json."""
return dict(
token=auth_token,
expired_at='2017-06-05 00:14:12',
initiate_screen='timeline',
user=user_response,
user=user.get_response_ok(),
panel=panel.get_response_ok(),
permissions=dict(
premium_streaming='0',
Expand Down
20 changes: 7 additions & 13 deletions tests/test_abode.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ def test_manual_login_with_mfa(self, m):

def test_auto_login(self, m):
"""Test that automatic login works."""
auth_token = MOCK.AUTH_TOKEN
user_json = USER.get_response_ok()
login_json = LOGIN.post_response_ok(auth_token, user_json)
login_json = LOGIN.post_response_ok()
panel_json = PANEL.get_response_ok()

m.post(urls.LOGIN, json=login_json)
Expand All @@ -88,7 +86,7 @@ def test_auto_login(self, m):
assert client._password == 'buzz'
assert client._token == MOCK.AUTH_TOKEN
assert client._panel == panel_json
assert client._user == user_json
assert client._user == USER.get_response_ok()
assert client._devices is None
assert client._automations is None

Expand All @@ -98,9 +96,7 @@ def test_auto_login(self, m):

def test_auto_fetch(self, m):
"""Test that automatic device and automation retrieval works."""
auth_token = MOCK.AUTH_TOKEN
user_json = USER.get_response_ok()
login_json = LOGIN.post_response_ok(auth_token, user_json)
login_json = LOGIN.post_response_ok()
panel_json = PANEL.get_response_ok()

m.post(urls.LOGIN, json=login_json)
Expand All @@ -121,7 +117,7 @@ def test_auto_fetch(self, m):
assert client._username == 'fizz'
assert client._password == 'buzz'
assert client._token == MOCK.AUTH_TOKEN
assert client._user == user_json
assert client._user == USER.get_response_ok()
assert client._panel is not None

# Contains one device, our alarm
Expand Down Expand Up @@ -207,9 +203,7 @@ def test_logout_exception(self, m):

def test_full_setup(self, m):
"""Check that Abode is set up properly."""
auth_token = MOCK.AUTH_TOKEN
user_json = USER.get_response_ok()
login_json = LOGIN.post_response_ok(auth_token, user_json)
login_json = LOGIN.post_response_ok()
panel_json = PANEL.get_response_ok()

m.post(urls.LOGIN, json=login_json)
Expand All @@ -224,8 +218,8 @@ def test_full_setup(self, m):

assert self.client._username == USERNAME
assert self.client._password == PASSWORD
assert self.client._token == auth_token
assert self.client._user == user_json
assert self.client._token == MOCK.AUTH_TOKEN
assert self.client._user == USER.get_response_ok()
assert self.client._panel is not None
assert self.client.get_alarm() is not None
assert self.client._get_session() is not None
Expand Down

0 comments on commit 0ce47bc

Please sign in to comment.