瀏覽代碼

AMBARI-5202. Ambari Server tests not completing on Mac (aonishuk)

Andrew Onischuk 11 年之前
父節點
當前提交
b51bfea4e7
共有 2 個文件被更改,包括 5 次插入2 次删除
  1. 4 2
      ambari-server/src/test/python/TestAmbariServer.py
  2. 1 0
      ambari-server/src/test/python/unitTests.py

+ 4 - 2
ambari-server/src/test/python/TestAmbariServer.py

@@ -33,8 +33,10 @@ import platform
 from pwd import getpwnam
 from ambari_server.resourceFilesKeeper import ResourceFilesKeeper, KeeperException
 
-# We have to use this import HACK because the filename contains a dash
-ambari_server = __import__('ambari-server')
+with patch("platform.linux_distribution", return_value = ('Suse','11','Final')):
+  # We have to use this import HACK because the filename contains a dash
+  ambari_server = __import__('ambari-server')
+  
 FatalException = ambari_server.FatalException
 NonFatalException = ambari_server.NonFatalException
 

+ 1 - 0
ambari-server/src/test/python/unitTests.py

@@ -117,6 +117,7 @@ def main():
   ambari_agent_folder = os.path.join(ambari_server_folder,"../ambari-agent")
   ambari_common_folder = os.path.join(ambari_server_folder,"../ambari-common")
   sys.path.append(ambari_common_folder + "/src/main/python/jinja2")
+  sys.path.append(ambari_common_folder + "/src/main/python")
   sys.path.append(ambari_common_folder + "/src/test/python")
   sys.path.append(ambari_agent_folder + "/src/main/python")
   sys.path.append(ambari_server_folder + "/src/test/python")