tests/sleeptest: Make use of the new accessors

Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 ecd8a981
......@@ -27,13 +27,18 @@ class sleeptest(test.Test):
Example test for avocado.
"""
def setup(self):
"""
If no config was provided, give self.params.sleep_length a default.
"""
self.params.set_default('sleep_length', 1.0)
def action(self):
"""
Sleep for length seconds.
"""
length = self.params.get('sleep_length', 1.0)
self.log.debug("Sleeping for %.2f seconds", length)
time.sleep(length)
self.log.debug("Sleeping for %.2f seconds", self.params.sleep_length)
time.sleep(self.params.sleep_length)
if __name__ == "__main__":
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册