🎨 Fix some whitespace issues
This commit is contained in:
1 parent
ff59e275bf
commit
dfcddea581
1 file changed
+15
-15
@@ -329,24 +329,24 @@ class FileManagerTest(unittest.TestCase):
|
||||
|
||||
@mock.patch("os.path.isfile", return_value=True)
|
||||
def test_get_recovery_data(self, mock_isfile):
|
||||
import os
|
||||
import yaml
|
||||
recovery_file = os.path.join("/path/to/a/base_folder", "print_recovery_data.yaml")
|
||||
import os
|
||||
import yaml
|
||||
recovery_file = os.path.join("/path/to/a/base_folder", "print_recovery_data.yaml")
|
||||
|
||||
data = dict(path="some_path.gco",
|
||||
origin="local",
|
||||
pos=1234,
|
||||
date=123456789)
|
||||
text_data = yaml.dump(data)
|
||||
data = dict(path="some_path.gco",
|
||||
origin="local",
|
||||
pos=1234,
|
||||
date=123456789)
|
||||
text_data = yaml.dump(data)
|
||||
|
||||
with mock.patch("__builtin__.open", mock.mock_open(read_data=text_data)) as m:
|
||||
# moved safe_load to here so we could mock up the return value properly
|
||||
with mock.patch("yaml.safe_load", return_value=data) as n:
|
||||
result = self.file_manager.get_recovery_data()
|
||||
with mock.patch("__builtin__.open", mock.mock_open(read_data=text_data)) as m:
|
||||
# moved safe_load to here so we could mock up the return value properly
|
||||
with mock.patch("yaml.safe_load", return_value=data) as n:
|
||||
result = self.file_manager.get_recovery_data()
|
||||
|
||||
self.assertDictEqual(data, result)
|
||||
n.assert_called_with(m())
|
||||
mock_isfile.assert_called_with(recovery_file)
|
||||
self.assertDictEqual(data, result)
|
||||
n.assert_called_with(m())
|
||||
mock_isfile.assert_called_with(recovery_file)
|
||||
|
||||
@mock.patch("os.path.isfile")
|
||||
def test_get_recovery_data_no_file(self, mock_isfile):
|
||||
|
||||
Reference in new issue
Block a user