rename Type => CdistType
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
parent
1314567012
commit
fb4f8784b6
7 changed files with 50 additions and 48 deletions
|
|
@ -49,8 +49,10 @@ class ExplorerClassTestCase(test.CdistTestCase):
|
|||
|
||||
self.remote_base_path = self.mkdtemp()
|
||||
self.user = getpass.getuser()
|
||||
remote_exec = "ssh -o User=%s -q" % self.user
|
||||
remote_copy = "scp -o User=%s -q" % self.user
|
||||
#remote_exec = "ssh -o User=%s -q" % self.user
|
||||
#remote_copy = "scp -o User=%s -q" % self.user
|
||||
remote_exec = "ssh -o User=%s -q" % "root"
|
||||
remote_copy = "scp -o User=%s -q" % "root"
|
||||
self.remote = remote.Remote(self.target_host, self.remote_base_path, remote_exec, remote_copy)
|
||||
|
||||
self.explorer = explorer.Explorer(self.target_host, self.local, self.remote)
|
||||
|
|
@ -83,19 +85,19 @@ class ExplorerClassTestCase(test.CdistTestCase):
|
|||
shutil.rmtree(out_path)
|
||||
|
||||
def test_list_type_explorer_names(self):
|
||||
cdist_type = core.Type(self.local.type_path, '__test_type')
|
||||
cdist_type = core.CdistType(self.local.type_path, '__test_type')
|
||||
expected = cdist_type.explorers
|
||||
self.assertEqual(self.explorer.list_type_explorer_names(cdist_type), expected)
|
||||
|
||||
def test_transfer_type_explorers(self):
|
||||
cdist_type = core.Type(self.local.type_path, '__test_type')
|
||||
cdist_type = core.CdistType(self.local.type_path, '__test_type')
|
||||
self.explorer.transfer_type_explorers(cdist_type)
|
||||
source = os.path.join(self.local.type_path, cdist_type.explorer_path)
|
||||
destination = os.path.join(self.remote.type_path, cdist_type.explorer_path)
|
||||
self.assertEqual(os.listdir(source), os.listdir(destination))
|
||||
|
||||
def test_transfer_type_explorers_only_once(self):
|
||||
cdist_type = core.Type(self.local.type_path, '__test_type')
|
||||
cdist_type = core.CdistType(self.local.type_path, '__test_type')
|
||||
# first transfer
|
||||
self.explorer.transfer_type_explorers(cdist_type)
|
||||
source = os.path.join(self.local.type_path, cdist_type.explorer_path)
|
||||
|
|
@ -109,7 +111,7 @@ class ExplorerClassTestCase(test.CdistTestCase):
|
|||
self.assertFalse(os.listdir(destination))
|
||||
|
||||
def test_transfer_object_parameters(self):
|
||||
cdist_type = core.Type(self.local.type_path, '__test_type')
|
||||
cdist_type = core.CdistType(self.local.type_path, '__test_type')
|
||||
cdist_object = core.CdistObject(cdist_type, self.local.object_path, 'whatever')
|
||||
cdist_object.create()
|
||||
cdist_object.parameters = {'first': 'first value', 'second': 'second value'}
|
||||
|
|
@ -119,14 +121,14 @@ class ExplorerClassTestCase(test.CdistTestCase):
|
|||
self.assertEqual(sorted(os.listdir(source)), sorted(os.listdir(destination)))
|
||||
|
||||
def test_run_type_explorer(self):
|
||||
cdist_type = core.Type(self.local.type_path, '__test_type')
|
||||
cdist_type = core.CdistType(self.local.type_path, '__test_type')
|
||||
cdist_object = core.CdistObject(cdist_type, self.local.object_path, 'whatever')
|
||||
self.explorer.transfer_type_explorers(cdist_type)
|
||||
output = self.explorer.run_type_explorer('world', cdist_object)
|
||||
self.assertEqual(output, 'hello\n')
|
||||
|
||||
def test_run_type_explorers(self):
|
||||
cdist_type = core.Type(self.local.type_path, '__test_type')
|
||||
cdist_type = core.CdistType(self.local.type_path, '__test_type')
|
||||
cdist_object = core.CdistObject(cdist_type, self.local.object_path, 'whatever')
|
||||
cdist_object.create()
|
||||
self.explorer.run_type_explorers(cdist_object)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue