| Index: lib/naclports/tests/test_binary_package.py
|
| diff --git a/lib/naclports/tests/test_binary_package.py b/lib/naclports/tests/test_binary_package.py
|
| index 132fe3384ac028b115e23d61b8594079e0749ad2..ea9f79ad9addd4db7ed1c0ce543f078e855cd601 100644
|
| --- a/lib/naclports/tests/test_binary_package.py
|
| +++ b/lib/naclports/tests/test_binary_package.py
|
| @@ -16,9 +16,11 @@ class TestBinaryPackage(common.NaclportsTest):
|
| @patch('os.makedirs')
|
| @patch('os.path.isdir', Mock(return_value=False))
|
| def testInstallFile(self, makedirs_mock, rename_mock):
|
| - binary_package.InstallFile('fname', 'location1', 'location2')
|
| - makedirs_mock.assert_called_once_with('location2')
|
| - rename_mock.assert_has_calls([call('location1/fname', 'location2/fname')])
|
| + mock_file = common.MockFileObject()
|
| + with patch('__builtin__.open', Mock(return_value=mock_file)):
|
| + binary_package.InstallFile('fname', 'location1', 'location2')
|
| + makedirs_mock.assert_called_once_with('location2')
|
| + rename_mock.assert_has_calls([call('location1/fname', 'location2/fname')])
|
|
|
| def testRelocateFile(self):
|
| # Only certain files should be relocated. A file called 'testfile'
|
|
|