Пример #1
0
    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')
Пример #2
0
 def _list_all_references_for_host(self, host):
     references_path = self._references_path_from_host(host)
     return list_all_files(references_path)
Пример #3
0
    def list_all_files(self, path):
	return list_all_files(path, self.rpyc_conn) 
Пример #4
0
    def test_list_all_files_returns_flattened_list(self):
        ret = list_all_files('/some/path')

        self.assertEqual(ret, self.flatten.return_value)
Пример #5
0
    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])
Пример #6
0
    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)
Пример #7
0
    def test_list_all_files_walks_directory(self):
        list_all_files('/some/path')

        self.os.walk.assert_called_once_with('/some/path')