Skip to content

Commit

Permalink
Fixtestrunningbug (#26)
Browse files Browse the repository at this point in the history
* Fix minor test bug

* Add unittests

* Small refactor in test
  • Loading branch information
andresp authored Oct 29, 2023
1 parent 51334b9 commit 0f02fdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_technicolorxb7.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ def test_init(self):
@responses.activate
def test_succcessful_login(self):

responses.add(responses.POST, 'http://localhost:5000/check.jst', json={}, status=302)
responses.add(responses.POST, f'http://{config["Modem"]["Host"]}/check.jst', json={}, status=302)

instance = ObservableModemFactory.get("TechnicolorXB7", config, logging.getLogger(None))
instance.login()

@responses.activate
def test_invalid_login(self):
responses.add(responses.POST, 'http://localhost:5000/check.jst', json={}, status=200)
responses.add(responses.POST, f'http://{config["Modem"]["Host"]}/check.jst', json={}, status=200)

instance = ObservableModemFactory.get("TechnicolorXB7", config, logging.getLogger(None))
with pytest.raises(ModemCredentialsError):
Expand Down

0 comments on commit 0f02fdc

Please sign in to comment.