From c40c9ccf2ac914af9165bdf2d2acd82b08af566b Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Wed, 12 Dec 2018 19:13:21 +0100 Subject: [PATCH] add a test for string resource_version a convinience for e.g. custom resources which deserializes the value as a string --- watch/watch_test.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/watch/watch_test.py b/watch/watch_test.py index 830005c5..3d9f5de1 100644 --- a/watch/watch_test.py +++ b/watch/watch_test.py @@ -98,6 +98,15 @@ def test_watch_resource_version_set(self): if count == len(values) * 3: w.stop() + count = 1 + fake_api.get_namespaces.reset_mock() + # test it also works with a string resource version which you get from + # deserializing custom objects + for e in w.stream(fake_api.get_namespaces, resource_version="5"): + count += 1 + if count == len(values) * 3: + w.stop() + def test_watch_stream_twice(self): w = Watch(float) for step in ['first', 'second']: