From 5f9445d0c8848bd326f03bd39bd9d96edd14984d Mon Sep 17 00:00:00 2001 From: neturmel <74895293+neturmel@users.noreply.github.com> Date: Thu, 2 Sep 2021 13:50:08 +0200 Subject: [PATCH] Delete test_g1vacuum.py Test removed --- miio/tests/test_g1vacuum.py | 85 ------------------------------------- 1 file changed, 85 deletions(-) delete mode 100644 miio/tests/test_g1vacuum.py diff --git a/miio/tests/test_g1vacuum.py b/miio/tests/test_g1vacuum.py deleted file mode 100644 index af8877cdf..000000000 --- a/miio/tests/test_g1vacuum.py +++ /dev/null @@ -1,85 +0,0 @@ -from unittest import TestCase - -import pytest - -from miio.g1vacuum import ( - G1ChargeState, - G1FanSpeed, - G1MopState, - G1State, - G1Vacuum, - G1VacuumMode, - G1WaterLevel, -) - -from .dummies import DummyMiotDevice - -_INITIAL_STATE = { - "battery_level": 42, - "charge_state": G1ChargeState.Charging, - "error_code": 0, - "state": G1State.Paused, - "fan_speed": G1FanSpeed.Medium, - "operating_mode": G1VacuumMode.GlobalClean, - "mop_state": G1MopState.Off, - "water_level": G1WaterLevel.Level1, - "main_brush_time_left": 235, - "main_brush_life_level": 85, - "filter_life_level": 66, - "filter_left_time": 154, - "side_brush_life_left": 187, - "side_brush_life_level": 57, - "clean_area": 12, - "clean_time": 17, - "total_clean_area": 0, - "total_clean_time": 0, - "total_clean_count": 0, -} - - -class DummyG1Vacuum(DummyMiotDevice, G1Vacuum): - def __init__(self, *args, **kwargs): - self.state = _INITIAL_STATE - super().__init__(*args, **kwargs) - - -@pytest.fixture(scope="function") -def dummyg1vacuum(request): - request.cls.device = DummyG1Vacuum() - - -@pytest.mark.usefixtures("dummyg1vacuum") -class TestG1Vacuum(TestCase): - def test_status(self): - status = self.device.status() - assert status.battery == _INITIAL_STATE["battery"] - assert status.error_code == _INITIAL_STATE["error_code"] - assert status.main_brush_time_left == _INITIAL_STATE["main_brush_time_left"] - assert status.side_brush_life_left == _INITIAL_STATE["side_brush_life_left"] - assert status.side_brush_life_level == _INITIAL_STATE["side_brush_life_level"] - assert status.main_brush_time_level == _INITIAL_STATE["main_brush_time_level"] - assert status.filter_left_time == _INITIAL_STATE["filter_left_time"] - assert status.filter_life_level == _INITIAL_STATE["filter_life_level"] - assert status.clean_area == _INITIAL_STATE["clean_area"] - assert status.clean_time == _INITIAL_STATE["clean_time"] - assert status.total_clean_area == _INITIAL_STATE["total_clean_area"] - assert status.total_clean_time == _INITIAL_STATE["total_clean_time"] - assert status.total_clean_count == _INITIAL_STATE["total_clean_count"] - assert status.charge_state == G1ChargeState(_INITIAL_STATE["charge_state"]) - assert repr(status.charge_state) == repr( - G1ChargeState(_INITIAL_STATE["charge_state"]) - ) - assert status.fan_speed == G1FanSpeed(_INITIAL_STATE["fan_speed"]) - assert repr(status.fan_speed) == repr(G1FanSpeed(_INITIAL_STATE["fan_speed"])) - assert status.state == G1State(_INITIAL_STATE["state"]) - assert repr(status.state) == repr(G1State(_INITIAL_STATE["state"])) - assert status.operating_mode == G1VacuumMode(_INITIAL_STATE["operating_mode"]) - assert repr(status.operating_mode) == repr( - G1VacuumMode(_INITIAL_STATE["operating_mode"]) - ) - assert status.mop_state == G1MopState(_INITIAL_STATE["mop_state"]) - assert repr(status.mop_state) == repr(G1MopState(_INITIAL_STATE["mop_state"])) - assert status.water_level == G1WaterLevel(_INITIAL_STATE["water_level"]) - assert repr(status.water_level) == repr( - G1WaterLevel(_INITIAL_STATE["water_level"]) - )