Пример #1
0
    def test_success_or_exception_succes(self, logger):
        input_string = 'Success'
        succes_msg = 'action succes'
        fail_msg = 'action fail'

        Adb.success_or_exception(input_string, succes_msg, fail_msg)

        logger.assert_called_once_with(succes_msg)
Пример #2
0
    def test_success_or_exception_exception(self, logger):
        input_string = 'fail'
        succes_msg = 'action succes'
        fail_msg = 'action fail'

        with pytest.raises(Adb.AdbError):
            Adb.success_or_exception(input_string, succes_msg, fail_msg)

        logger.assert_called_once_with(
            fail_msg + '\nMessage returned:\n{}'.format(input_string))