From 384aba465447f55d7e0e3996d75e85f9f04bde6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Sun, 26 Apr 2015 21:08:36 +0200 Subject: [PATCH] Sleep plugin sleeps on request too --- tests/sleep_plugin/sleep.py | 1 + tests/sleep_plugin/sleep.senpy | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/sleep_plugin/sleep.py b/tests/sleep_plugin/sleep.py index 50449b8..6468794 100644 --- a/tests/sleep_plugin/sleep.py +++ b/tests/sleep_plugin/sleep.py @@ -13,4 +13,5 @@ class SleepPlugin(SenpyPlugin): sleep(self.timeout) def analyse(self, *args, **kwargs): + sleep(float(kwargs.get("timeout", self.timeout))) return Response() diff --git a/tests/sleep_plugin/sleep.senpy b/tests/sleep_plugin/sleep.senpy index 6920a77..eaea86f 100644 --- a/tests/sleep_plugin/sleep.senpy +++ b/tests/sleep_plugin/sleep.senpy @@ -4,5 +4,13 @@ "description": "I am dummy", "author": "@balkian", "version": "0.1", - "timeout": "2" + "timeout": "2", + "extra_params": { + "timeout": { + "@id": "timeout_sleep", + "aliases": ["timeout", "to"], + "required": false, + "default": 0 + } + } }