You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ol...@apache.org on 2016/04/14 21:39:29 UTC
ambari git commit: AMBARI-15890. UT framework was not python 2.6
compatible (Miklos Gergely via oleewere)
Repository: ambari
Updated Branches:
refs/heads/trunk dfe6f023a -> 921fda705
AMBARI-15890. UT framework was not python 2.6 compatible (Miklos Gergely via oleewere)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/921fda70
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/921fda70
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/921fda70
Branch: refs/heads/trunk
Commit: 921fda7054035e1650b818b3bcf3a4621e21dbfc
Parents: dfe6f02
Author: miki.gergely <mg...@hortonworks.com>
Authored: Thu Apr 14 21:35:49 2016 +0200
Committer: oleewere <ol...@gmail.com>
Committed: Thu Apr 14 21:36:15 2016 +0200
----------------------------------------------------------------------
ambari-server/src/test/python/stacks/utils/RMFTestCase.py | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/921fda70/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 dd82430..2677921 100644
--- a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
+++ b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
@@ -29,6 +29,7 @@ import pprint
import itertools
from mock.mock import MagicMock, patch
import platform
+import re
with patch("platform.linux_distribution", return_value = ('Suse','11','Final')):
from resource_management.core.environment import Environment
@@ -265,6 +266,10 @@ class RMFTestCase(TestCase):
actual_value = kwargs.get(key, '')
self.assertRegexpMatches(resource_value, actual_value, msg="Key " + key + " doesn't match")
+ def assertRegexpMatches(self, value, pattern, msg=None):
+ if not re.match(pattern, value):
+ raise AssertionError, msg or 'pattern %s does not match %s' % (pattern, value)
+
def assertNoMoreResources(self):
self.assertEquals(len(RMFTestCase.env.resource_list), 0, "There were other resources executed!")