-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to demonstrate class-based thermostats
- Loading branch information
1 parent
7de3539
commit cf6f960
Showing
6 changed files
with
49 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ test.py | |
build/ | ||
dist/ | ||
.pytest_cache/v/cache/lastfailed | ||
coverage.xml |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import unittest | ||
from heatmiserv3 import connection | ||
|
||
class TestConnection(unittest.TestCase): | ||
"""Tests for the connection code""" | ||
def test_init(self): | ||
uh1 = connection.HeatmiserUH1("mock", 123) | ||
assert uh1.status == True | ||
|
||
def test_open(self): | ||
uh1 = connection.HeatmiserUH1("mock", 123) | ||
assert uh1.status == True | ||
uh1._open() | ||
assert uh1.status == True | ||
|
||
def xtest_reopen(self): | ||
"""Skipping this test as doesn't work with mock implementation.""" | ||
uh1 = connection.HeatmiserUH1("mock", 123) | ||
uh1.serialport.close() | ||
assert uh1.serialport.closed == True | ||
|
||
def test_registration(self): | ||
uh1 = connection.HeatmiserUH1("mock", 123) | ||
try: | ||
uh1.registerThermostat(1) | ||
except Exception as e: | ||
assert type(e) == AttributeError |
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