示例#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
文件: __init__.py 项目: vdloo/messor
 def _list_all_references_for_host(self, host):
     references_path = self._references_path_from_host(host)
     return list_all_files(references_path)
示例#3
0
文件: __init__.py 项目: vdloo/messor
    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')