From 63ad8825127cfa75f0ae74c25cf5538b596aab93 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 14 Oct 2011 15:58:42 +0200 Subject: [PATCH] update test: run_code* should no longer return output Signed-off-by: Steven Armstrong --- lib/cdist/test/code/__init__.py | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/lib/cdist/test/code/__init__.py b/lib/cdist/test/code/__init__.py index 0d7aec75..f661ad24 100644 --- a/lib/cdist/test/code/__init__.py +++ b/lib/cdist/test/code/__init__.py @@ -105,33 +105,11 @@ class CodeTestCase(unittest.TestCase): destination = os.path.join(self.remote.object_path, self.cdist_object.code_remote_path) self.assertTrue(os.path.isfile(destination)) - def test_run_code_local_environment(self): + def test_run_code_local(self): self.cdist_object.code_local = self.code.run_gencode_local(self.cdist_object) - output_string = self.code.run_code_local(self.cdist_object) - output_dict = {} - for line in output_string.split('\n'): - if line: - key,value = line.split(': ') - output_dict[key] = value - self.assertEqual(output_dict['__target_host'], self.local.target_host) - self.assertEqual(output_dict['__global'], self.local.out_path) - self.assertEqual(output_dict['__type'], self.cdist_type.absolute_path) - self.assertEqual(output_dict['__object'], self.cdist_object.absolute_path) - self.assertEqual(output_dict['__object_id'], self.cdist_object.object_id) - self.assertEqual(output_dict['__object_fq'], self.cdist_object.path) + self.code.run_code_local(self.cdist_object) def test_run_code_remote_environment(self): self.cdist_object.code_remote = self.code.run_gencode_remote(self.cdist_object) self.code.transfer_code_remote(self.cdist_object) - output_string = self.code.run_code_remote(self.cdist_object) - output_dict = {} - for line in output_string.split('\n'): - if line: - key,value = line.split(': ') - output_dict[key] = value - self.assertEqual(output_dict['__target_host'], self.local.target_host) - self.assertEqual(output_dict['__global'], self.local.out_path) - self.assertEqual(output_dict['__type'], self.cdist_type.absolute_path) - self.assertEqual(output_dict['__object'], self.cdist_object.absolute_path) - self.assertEqual(output_dict['__object_id'], self.cdist_object.object_id) - self.assertEqual(output_dict['__object_fq'], self.cdist_object.path) + self.code.run_code_remote(self.cdist_object)