Fix inadvertent generation of file during tox test

When running py27 or py34 tox tests, a '4321_4321_4321.dat' file is
created and not cleaned up. This is due to a missing mock in the
module_retrieve test.

The 'open' method is now mocked and the file is not created.

Change-Id: I8e2524961b3cb2ac01b65d5ce11d476ad3a81662
Closed-Bug: #1565959
This commit is contained in:
Peter Stachowski 2016-04-04 19:09:25 +00:00
parent 4b2d76931b
commit 967f0ff837

View File

@ -600,6 +600,7 @@ class ShellTest(utils.TestCase):
def test_module_retrieve(self):
with mock.patch.object(troveclient.v1.modules.Module, '__getattr__',
mock.Mock(return_value='4321')):
with mock.patch.object(builtins, 'open'):
self.run_command('module-retrieve 1234')
self.assert_called(
'GET',