def test_handle_connection_errors(self, exception_type) -> None:

        check = Mpd("test", None, None, None)  # type: ignore

        def _get_state():
            raise exception_type()

        check._get_state = _get_state  # type: ignore

        with pytest.raises(TemporaryCheckError):
            check.check()
Пример #2
0
    def test_handle_connection_errors(self):

        check = Mpd('test', None, None, None)

        def _get_state():
            raise ConnectionError()

        check._get_state = _get_state

        with pytest.raises(TemporaryCheckError):
            check.check()