summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Pena <jpena@redhat.com>2016-08-16 13:08:45 +0200
committerJavier Pena <jpena@redhat.com>2017-02-13 12:24:12 +0100
commitabad2ebdb1fab19d7cde11581b3f2fd327694a7e (patch)
tree099f4076ec15b85945cac0eff4bf1212fa46d60c
parentf7c0582c48f0b363ed642f2773d85eee72075f2c (diff)
downloadoslo-vmware-abad2ebdb1fab19d7cde11581b3f2fd327694a7e.tar.gz
Make the mock call in MemoryCacheTest forward-compatible
Previously, we were only mocking the call to suds.reader.DocumentReader.download, and this call is removed in later versions of suds-jurko (see https://bitbucket.org/jurko/suds/commits/46f1501e66c90e9d677ec918f995309f16ee8c21). Updating the mock patch to work with both the current and later version of suds-jurko. Change-Id: Iaa0b68fd2ad0ef6934410bcf5bebf9957a63d11e
-rw-r--r--oslo_vmware/tests/test_service.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/oslo_vmware/tests/test_service.py b/oslo_vmware/tests/test_service.py
index b51099b..dc28cd2 100644
--- a/oslo_vmware/tests/test_service.py
+++ b/oslo_vmware/tests/test_service.py
@@ -419,8 +419,9 @@ class MemoryCacheTest(base.TestCase):
self.assertEqual('value2', cache.get('key2'))
self.assertIsNone(cache.get('key3'))
- @mock.patch('suds.reader.DocumentReader.download')
- def test_shared_cache(self, mock_reader):
+ @mock.patch('suds.reader.DefinitionsReader.open')
+ @mock.patch('suds.reader.DocumentReader.download', create=True)
+ def test_shared_cache(self, mock_reader, mock_open):
cache1 = service.Service().client.options.cache
cache2 = service.Service().client.options.cache
self.assertIs(cache1, cache2)