def test_customized_message(self): tout = KeywordTimeout('1s', 'My message', VariableMock()) tout.start() tout.run(passing) tout.secs = 0.001 assert_raises_with_msg(TimeoutError, 'My message', tout.run, sleeping, (10,))
def test_failed_custom(self): tout = KeywordTimeout('1s', 'Custom message', VariableMock()) tout.starttime = time.time() - 2 assert_equals(tout.get_message(), 'Custom message')
def test_active(self): tout = KeywordTimeout('42s', variables=VariableMock()) tout.start() msg = tout.get_message() assert_true(msg.startswith('Keyword timeout 42 seconds active.'), msg) assert_true(msg.endswith('seconds left.'), msg)
def __init__(self, name='Mock Handler', doc='Mock Doc', error=False): self.name = self.longname = name self.doc = self.shortdoc = doc self.error = error self.timeout = KeywordTimeout()
def test_failed_custom(self): tout = KeywordTimeout('1s', 'Custom message', VariableMock()) tout.starttime = time.time() - 2 assert_equal(tout.get_message(), 'Custom message')
def wrapper(*args, **kwargs): timeout_msg = func.__name__ + " timed out !!" timeout = KeywordTimeout(timeoutinseconds, timeout_msg, VariableScopes(RobotSettings())) timeout.start() return timeout.run(func, args, kwargs)
def test_failed_custom(self): tout = KeywordTimeout("1s", "Custom message", VariableMock()) tout.starttime = time.time() - 2 assert_equal(tout.get_message(), "Custom message")