Skip to content

Commit

Permalink
keep test for unsupported storage
Browse files Browse the repository at this point in the history
  • Loading branch information
csett86 committed Jan 5, 2022
1 parent 47445f5 commit 491278d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyfronius/tests/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class FroniusHelperTest(unittest.TestCase):
def test_error_code(self):
res = web_state.GET_INVERTER_REALTIME_DATA_SCOPE_DEVICE
self.assertEqual(Fronius.error_code(res), 0)
res = web_state.GET_STORAGE_REALTIME_DATA_SCOPE_DEVICE
res = web_state.GET_STORAGE_REALTIME_DATA_SCOPE_DEVICE_UNSUPPORTED
self.assertEqual(Fronius.error_code(res), 255)

def test_error_reason(self):
res = web_state.GET_INVERTER_REALTIME_DATA_SCOPE_DEVICE
self.assertEqual(Fronius.error_reason(res), "")
res = web_state.GET_STORAGE_REALTIME_DATA_SCOPE_DEVICE
res = web_state.GET_STORAGE_REALTIME_DATA_SCOPE_DEVICE_UNSUPPORTED
self.assertEqual(Fronius.error_reason(res), "Storages are not supported")
5 changes: 5 additions & 0 deletions pyfronius/tests/web_raw/v1/web_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
"led_color": {"value": 1},
}

GET_STORAGE_REALTIME_DATA_SCOPE_DEVICE_UNSUPPORTED = {
"timestamp": {"value": "2019-01-10T23:33:14+01:00"},
"status": {"Code": 255, "Reason": "Storages are not supported", "UserMessage": ""},
}

GET_STORAGE_REALTIME_DATA_SCOPE_DEVICE = {
"timestamp": {"value": "2022-01-05T18:10:02+01:00"},
"status": {"Code": 0, "Reason": "", "UserMessage": ""},
Expand Down

0 comments on commit 491278d

Please sign in to comment.