Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Sep 15, 2022
1 parent 38959e0 commit 789b58b
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions miio/integrations/vacuum/roborock/tests/test_vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,34 @@ def __init__(self, *args, **kwargs):
"water_box_status": 1,
}

self.dummies = {}
self.dummies["consumables"] = [
{
"filter_work_time": 32454,
"sensor_dirty_time": 3798,
"side_brush_work_time": 32454,
"main_brush_work_time": 32454,
}
]
self.dummies["clean_summary"] = [
174145,
2410150000,
82,
[
1488240000,
1488153600,
1488067200,
1487980800,
1487894400,
1487808000,
1487548800,
],
]

self.return_values = {
"get_status": self.vacuum_state,
"get_status": lambda x: [self.state],
"get_consumable": lambda x: self.dummies["consumables"],
"get_clean_summary": lambda x: self.dummies["clean_summary"],
"app_start": lambda x: self.change_mode("start"),
"app_stop": lambda x: self.change_mode("stop"),
"app_pause": lambda x: self.change_mode("pause"),
Expand Down Expand Up @@ -77,9 +103,6 @@ def change_mode(self, new_mode):
elif new_mode == "charge":
self.state["state"] = DummyVacuum.STATE_CHARGING

def vacuum_state(self, _):
return [self.state]


@pytest.fixture(scope="class")
def dummyvacuum(request):
Expand Down

0 comments on commit 789b58b

Please sign in to comment.