fix all explorer test cases

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
Nico Schottelius 2012-11-06 16:47:51 +01:00
parent 9bdb715b7d
commit 4a67d768d5

View file

@ -60,6 +60,7 @@ class ExplorerClassTestCase(test.CdistTestCase):
self.remote_base_path, self.remote_base_path,
self.remote_exec, self.remote_exec,
self.remote_copy) self.remote_copy)
self.remote.create_files_dirs()
self.explorer = explorer.Explorer( self.explorer = explorer.Explorer(
self.target_host, self.target_host,
@ -83,14 +84,20 @@ class ExplorerClassTestCase(test.CdistTestCase):
self.assertEqual(sorted(os.listdir(source)), sorted(os.listdir(destination))) self.assertEqual(sorted(os.listdir(source)), sorted(os.listdir(destination)))
def test_run_global_explorer(self): def test_run_global_explorer(self):
"""Checkt that running ONE global explorer works"""
self.explorer.transfer_global_explorers() self.explorer.transfer_global_explorers()
output = self.explorer.run_global_explorer('global') output = self.explorer.run_global_explorer('global')
self.assertEqual(output, 'global\n') self.assertEqual(output, 'global\n')
def test_run_global_explorers(self): def test_run_global_explorers(self):
"""Ensure output is created for every global explorer"""
out_path = self.mkdtemp() out_path = self.mkdtemp()
self.explorer.run_global_explorers(out_path) self.explorer.run_global_explorers(out_path)
self.assertEqual(sorted(os.listdir(out_path)), sorted(['foobar', 'global'])) names = sorted(self.explorer.list_global_explorer_names())
output = sorted(os.listdir(out_path))
self.assertEqual(names, output)
shutil.rmtree(out_path) shutil.rmtree(out_path)
def test_list_type_explorer_names(self): def test_list_type_explorer_names(self):