Exemplo n.º 1
0
 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,))
Exemplo n.º 2
0
 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,))
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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 wrapper(*args, **kwargs):
     timeout_msg = func.__name__ + " timed out !!"
     timeout = KeywordTimeout(timeoutinseconds, timeout_msg,
                              VariableScopes(RobotSettings()))
     timeout.start()
     return timeout.run(func, args, kwargs)