You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2015/08/10 16:32:33 UTC
ambari git commit: AMBARI-12690. Fix python unittest to run on python
2.6.(vbrodetskyi)
Repository: ambari
Updated Branches:
refs/heads/trunk 4a9f2c2e9 -> bbb2bdc18
AMBARI-12690. Fix python unittest to run on python 2.6.(vbrodetskyi)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bbb2bdc1
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bbb2bdc1
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bbb2bdc1
Branch: refs/heads/trunk
Commit: bbb2bdc188086c0f04cadfcda140605408a95eb9
Parents: 4a9f2c2
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Mon Aug 10 17:32:35 2015 +0300
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Mon Aug 10 17:32:35 2015 +0300
----------------------------------------------------------------------
ambari-agent/src/test/python/ambari_agent/TestActionQueue.py | 2 +-
.../src/test/python/stacks/2.0.6/common/test_stack_advisor.py | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/bbb2bdc1/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py b/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
index 6e22bf8..d77adcc 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
@@ -257,7 +257,7 @@ class TestActionQueue(TestCase):
actionQueue.stop()
actionQueue.join()
self.assertEqual(actionQueue.stopped(), True, 'Action queue is not stopped.')
- self.assertGreater(process_command_mock.call_count, 1)
+ self.assertTrue(process_command_mock.call_count > 1)
@patch.object(OSCheck, "os_distribution", new = MagicMock(return_value = os_distro_value))
http://git-wip-us.apache.org/repos/asf/ambari/blob/bbb2bdc1/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index 94c53f6..33895be 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -970,7 +970,7 @@ class TestHDP206StackAdvisor(TestCase):
]}
properties = {"property1": "/var/dir"}
# only / mountpoint - no warning
- self.assertIsNone(self.stackAdvisor.validatorNotRootFs(properties, 'property1', hostInfo))
+ self.assertTrue(self.stackAdvisor.validatorNotRootFs(properties, 'property1', hostInfo) == None)
# More preferable /grid/0 mountpoint - warning
hostInfo["disk_info"].append(
{
@@ -980,7 +980,7 @@ class TestHDP206StackAdvisor(TestCase):
}
)
warn = self.stackAdvisor.validatorNotRootFs(properties, 'property1', hostInfo)
- self.assertIsNotNone(warn)
+ self.assertFalse(warn == None)
self.assertEquals({'message': 'The root device should not be used for property1', 'level': 'WARN'}, warn)
# Set by user /var mountpoint, which is non-root , but not preferable - no warning
@@ -991,4 +991,4 @@ class TestHDP206StackAdvisor(TestCase):
"mountpoint" : "/var"
}
)
- self.assertIsNone(self.stackAdvisor.validatorNotRootFs(properties, 'property1', hostInfo))
+ self.assertTrue(self.stackAdvisor.validatorNotRootFs(properties, 'property1', hostInfo) == None)