def test_list_all_files_uses_conn_if_specified(self): conn = Mock() conn.modules.os.walk.return_value = ['1'] list_all_files('/some/path', conn) conn.modules.os.walk.assert_called_once_with('/some/path')
def _list_all_references_for_host(self, host): references_path = self._references_path_from_host(host) return list_all_files(references_path)
def list_all_files(self, path): return list_all_files(path, self.rpyc_conn)
def test_list_all_files_returns_flattened_list(self): ret = list_all_files('/some/path') self.assertEqual(ret, self.flatten.return_value)
def test_list_all_files_flattens_stitched_lists(self): self.os.walk.return_value = ['1'] list_all_files('/some/path') self.flatten.assert_called_once_with([self.stitch.return_value])
def test_list_all_files_stitches_all_files_to_dirs(self): self.os.walk.return_value = ['1', '2', '3', '4'] list_all_files('/some/path') self.assertEqual(map(call, self.os.walk.return_value), self.stitch.mock_calls)
def test_list_all_files_walks_directory(self): list_all_files('/some/path') self.os.walk.assert_called_once_with('/some/path')