-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove test helper. add brand tests.
- Loading branch information
Showing
4 changed files
with
35 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
import responses | ||
|
||
from mock import patch | ||
from parameterized import parameterized | ||
from urllib.parse import urlencode | ||
|
||
from nuheat import NuHeat, NuHeatThermostat | ||
|
@@ -11,6 +12,18 @@ | |
class TestNuHeat(NuTestCase): | ||
# pylint: disable=protected-access | ||
|
||
@parameterized.expand([ | ||
(None, "mynuheat.com"), | ||
("NUHEAT", "mynuheat.com"), | ||
("BAD-BRAND", "mynuheat.com"), | ||
("MAPEHEAT", "mymapeheat.com"), | ||
]) | ||
def test_brands(self, brand, hostname): | ||
api = NuHeat("[email protected]", "secure-password", session_id=None, brand=brand) | ||
self.assertEqual(api._hostname, hostname) | ||
self.assertEqual(api._api_url, f"https://{hostname}/api") | ||
self.assertEqual(api._auth_url, f"https://{hostname}/api/authenticate/user") | ||
|
||
def test_init_with_session(self): | ||
existing_session_id = "passed-session" | ||
api = NuHeat("[email protected]", "secure-password", existing_session_id) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters