From abad2ebdb1fab19d7cde11581b3f2fd327694a7e Mon Sep 17 00:00:00 2001 From: Javier Pena Date: Tue, 16 Aug 2016 13:08:45 +0200 Subject: [PATCH] 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 --- oslo_vmware/tests/test_service.py | 5 +++-- 1 file 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)