From 04bd5d88c36482b82f50adad7928cb3409137df4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 6 Nov 2012 16:58:30 +0100 Subject: [PATCH] Fix tests for code Signed-off-by: Nico Schottelius --- cdist/exec/remote.py | 2 +- cdist/test/code/__init__.py | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cdist/exec/remote.py b/cdist/exec/remote.py index 07c6614b..d4d2cb2b 100644 --- a/cdist/exec/remote.py +++ b/cdist/exec/remote.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # 2011 Steven Armstrong (steven-cdist at armstrong.cc) -# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# 2011-2012 Nico Schottelius (nico-cdist at schottelius.org) # # This file is part of cdist. # diff --git a/cdist/test/code/__init__.py b/cdist/test/code/__init__.py index 8bc937b0..473c4b39 100644 --- a/cdist/test/code/__init__.py +++ b/cdist/test/code/__init__.py @@ -34,23 +34,27 @@ from cdist.core import code import os.path as op my_dir = op.abspath(op.dirname(__file__)) fixtures = op.join(my_dir, 'fixtures') -local_base_path = fixtures +conf_dir = op.join(fixtures, 'conf') class CodeTestCase(test.CdistTestCase): def setUp(self): self.target_host = 'localhost' - self.local_base_path = local_base_path self.out_path = self.mkdtemp() - self.local = local.Local(self.target_host, self.local_base_path, self.out_path) + + self.local = local.Local( + target_host=self.target_host, + out_path = self.out_path, + exec_path = cdist.test.cdist_exec_path, + add_conf_dirs=[conf_dir]) self.local.create_files_dirs() 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 = self.remote_exec + remote_copy = self.remote_copy self.remote = remote.Remote(self.target_host, self.remote_base_path, remote_exec, remote_copy) + self.remote.create_files_dirs() self.code = code.Code(self.target_host, self.local, self.remote)