From 14b46ea22bd65a19caf2c1fcef10ca3b484b6585 Mon Sep 17 00:00:00 2001 From: Theodoros Tsioutsias Date: Thu, 28 Feb 2019 09:54:43 +0000 Subject: [PATCH] FakeLoopingCall raises IOError All unittests using FakeLoopingCall raise an IOError if an initial delay is not specified, because the default initial_dealy is -1. Changing the default initial delay to 0. story: 2005112 task: 29748 Change-Id: I6cbae0996c2347e25d8be617e4b3fd93f4d9cc95 --- magnum/tests/fakes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/magnum/tests/fakes.py b/magnum/tests/fakes.py index 5febbbb219..caadba6a2b 100644 --- a/magnum/tests/fakes.py +++ b/magnum/tests/fakes.py @@ -110,10 +110,10 @@ class FakeLoopingCall(object): self.call_func = func def start(self, interval, **kwargs): - intitial_delay = kwargs.pop("initial_delay", -1) + initial_delay = kwargs.pop("initial_delay", 0) stop_on_exception = kwargs.pop("stop_on_exception", True) - if intitial_delay: - time.sleep(intitial_delay) + if initial_delay: + time.sleep(initial_delay) while True: try: self.call_func()