ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [1/2] git commit: AMBARI-5341 Namenode unittests are broken (aonishuk via dsen)
Date Fri, 04 Apr 2014 09:57:08 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 697a97b3f -> 9451ee052


AMBARI-5341 Namenode unittests are broken (aonishuk via dsen)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/233dd012
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/233dd012
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/233dd012

Branch: refs/heads/trunk
Commit: 233dd0124ac996e1a32095ca366e2970389bfdab
Parents: 697a97b
Author: Dmitry Sen <dsen@hortonworks.com>
Authored: Fri Apr 4 12:55:37 2014 +0300
Committer: Dmitry Sen <dsen@hortonworks.com>
Committed: Fri Apr 4 12:55:37 2014 +0300

----------------------------------------------------------------------
 .../src/test/python/stacks/utils/RMFTestCase.py          | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/233dd012/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
index 4cb6837..fe4e594 100644
--- a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
+++ b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
@@ -26,11 +26,13 @@ import imp
 import sys
 import pprint
 from mock.mock import MagicMock, patch
-from resource_management.core.environment import Environment
-from resource_management.libraries.script.config_dictionary import ConfigDictionary
-from resource_management.libraries.script.script import Script
-from resource_management.libraries.script.config_dictionary import UnknownConfiguration
 import platform
+with patch("platform.linux_distribution", return_value = ('Suse','11','Final')):
+  from resource_management.core.environment import Environment
+  from resource_management.libraries.script.config_dictionary import ConfigDictionary
+  from resource_management.libraries.script.script import Script
+  from resource_management.libraries.script.config_dictionary import UnknownConfiguration
+
 
 PATH_TO_STACKS = os.path.normpath("main/resources/stacks/HDP")
 PATH_TO_STACK_TESTS = os.path.normpath("test/python/stacks/")
@@ -90,6 +92,7 @@ class RMFTestCase(TestCase):
             with patch('resource_management.libraries.functions.get_kinit_path', return_value=kinit_path_local):
               with patch.object(platform, 'linux_distribution', return_value=os_type):
                 method(RMFTestCase.env)
+    sys.path.remove(scriptsdir)
   
   def getConfig(self):
     return self.config_dict


Mime
View raw message