Code Review
/
pti
/
o2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Update error handling; update selector; change delete response code to 200
[pti/o2.git]
/
tests
/
unit
/
test_watcher.py
diff --git
a/tests/unit/test_watcher.py
b/tests/unit/test_watcher.py
index
2fe82ab
..
5e1960f
100644
(file)
--- a/
tests/unit/test_watcher.py
+++ b/
tests/unit/test_watcher.py
@@
-54,6
+54,9
@@
class FakeOcloudClient(BaseClient):
def _list(self):
return [self.fakeCloud]
def _list(self):
return [self.fakeCloud]
+ def _set_stx_client(self):
+ pass
+
class FakeOcloudRepo(OcloudRepository):
def __init__(self):
class FakeOcloudRepo(OcloudRepository):
def __init__(self):
@@
-133,12
+136,12
@@
def create_fake_bus(uow):
publish: Callable):
return
publish: Callable):
return
- fakeuow = FakeUnitOfWork()
+
#
fakeuow = FakeUnitOfWork()
handlers.EVENT_HANDLERS = {}
handlers.COMMAND_HANDLERS = {
commands.UpdateOCloud: update_ocloud,
}
handlers.EVENT_HANDLERS = {}
handlers.COMMAND_HANDLERS = {
commands.UpdateOCloud: update_ocloud,
}
- bus = bootstrap.bootstrap(False,
fake
uow)
+ bus = bootstrap.bootstrap(False, uow)
return bus
return bus
@@
-169,7
+172,7
@@
def test_watchers_worker():
def _targetname(self):
return "fakeocloudwatcher"
def _targetname(self):
return "fakeocloudwatcher"
- def _probe(self, parent: object = None):
+ def _probe(self, parent: object = None
, tags=None
):
# import pdb; pdb.set_trace()
self.fakeOcloudWatcherCounter += 1
# hacking to stop the blocking sched task
# import pdb; pdb.set_trace()
self.fakeOcloudWatcherCounter += 1
# hacking to stop the blocking sched task
@@
-192,10
+195,10
@@
def test_watchers_worker():
count1 = fakewatcher.fakeOcloudWatcherCounter
testedworker.start()
count1 = fakewatcher.fakeOcloudWatcherCounter
testedworker.start()
- time.sleep(
20
)
+ time.sleep(
1
)
assert fakewatcher.fakeOcloudWatcherCounter > count1
# assumed hacking: probe has stopped the sched task
count3 = fakewatcher.fakeOcloudWatcherCounter
assert fakewatcher.fakeOcloudWatcherCounter > count1
# assumed hacking: probe has stopped the sched task
count3 = fakewatcher.fakeOcloudWatcherCounter
- time.sleep(
3
)
+ time.sleep(
1
)
assert fakewatcher.fakeOcloudWatcherCounter == count3
assert fakewatcher.fakeOcloudWatcherCounter == count3