def test_get_none_lighting_when_driver_none(self, repo: KrakenRepository, mocker: MockerFixture) -> None: # arrange mocker.patch.object( repo, '_driver', spec=None ) # act & assert assert repo.get_lighting_modes() is None
def test_lighting_modes_kraken_legacy(self, repo: KrakenRepository, mocker: MockerFixture) -> None: # arrange mocker.patch.object(repo, '_driver', spec=Legacy690Lc) # act lighting_modes = repo.get_lighting_modes() # assert assert isinstance(lighting_modes, LightingModes) assert len(lighting_modes.modes_logo) == 4 assert len(lighting_modes.modes_ring) == 0
def test_lighting_unknown_driver_type(self, repo: KrakenRepository, mocker: MockerFixture, caplog: LogCaptureFixture ) -> None: # arrange mocker.patch.object( repo, '_driver', # will likely never be supported by gkraken: spec=CorsairHidPsu ) caplog.at_level(logging.ERROR) # act lighting = repo.get_lighting_modes() # assert assert lighting is None assert 'Driver Instance is not recognized' in caplog.text