Repository: ambari Updated Branches: refs/heads/trunk 4d0296c67 -> b51bfea4e
AMBARI-5202. Ambari Server tests not completing on Mac (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b51bfea4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b51bfea4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b51bfea4 Branch: refs/heads/trunk Commit: b51bfea4e7d4852c4272c5f29735925f5c635d0a Parents: 4d0296c Author: Andrew Onischuk <[email protected]> Authored: Tue Mar 25 07:54:59 2014 -0700 Committer: Andrew Onischuk <[email protected]> Committed: Tue Mar 25 07:54:59 2014 -0700 ---------------------------------------------------------------------- ambari-server/src/test/python/TestAmbariServer.py | 6 ++++-- ambari-server/src/test/python/unitTests.py | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/b51bfea4/ambari-server/src/test/python/TestAmbariServer.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/TestAmbariServer.py b/ambari-server/src/test/python/TestAmbariServer.py index 00424c9..b63a3df 100644 --- a/ambari-server/src/test/python/TestAmbariServer.py +++ b/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 http://git-wip-us.apache.org/repos/asf/ambari/blob/b51bfea4/ambari-server/src/test/python/unitTests.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/unitTests.py b/ambari-server/src/test/python/unitTests.py index b983eb9..ebaa13a 100644 --- a/ambari-server/src/test/python/unitTests.py +++ b/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")
