From 5d2827f66ec9152e4e7928e9d4dd47f803f3d7ff Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 13 Oct 2011 00:24:52 +0200 Subject: [PATCH] tests for Remote paths Signed-off-by: Steven Armstrong --- lib/cdist/test/exec/test_remote.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/cdist/test/exec/test_remote.py b/lib/cdist/test/exec/test_remote.py index 1fdb5833..ea9a17aa 100644 --- a/lib/cdist/test/exec/test_remote.py +++ b/lib/cdist/test/exec/test_remote.py @@ -42,15 +42,31 @@ class RemoteTestCase(unittest.TestCase): def setUp(self): self.temp_dir = self.mkdtemp() target_host = 'localhost' - remote_base_path = self.temp_dir + self.base_path = self.temp_dir user = getpass.getuser() remote_exec = "ssh -o User=%s -q" % user remote_copy = "scp -o User=%s -q" % user - self.remote = remote.Remote(target_host, remote_base_path, remote_exec, remote_copy) + self.remote = remote.Remote(target_host, self.base_path, remote_exec, remote_copy) def tearDown(self): shutil.rmtree(self.temp_dir) + ### test api + + def test_conf_path(self): + self.assertEqual(self.remote.conf_path, os.path.join(self.base_path, "conf")) + + def test_object_path(self): + self.assertEqual(self.remote.object_path, os.path.join(self.base_path, "object")) + + def test_type_path(self): + self.assertEqual(self.remote.type_path, os.path.join(self.base_path, "conf", "type")) + + def test_global_explorer_path(self): + self.assertEqual(self.remote.global_explorer_path, os.path.join(self.base_path, "conf", "explorer")) + + ### /test api + def test_run_success(self): self.remote.run(['/bin/true'])