summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrico.lin <rico.lin.guanyu@gmail.com>2015-07-11 03:14:05 +0800
committerIan Cordasco <graffatcolmingov@gmail.com>2015-07-10 15:57:51 -0500
commite976032a95962d6f6c750a7812ffda155492bc73 (patch)
treee3e0ed41288ab5b20c758e9239d9fc26131caffb
parent0f9aa9911486f14d379dfe315d1cb91fb28bc14d (diff)
downloadpython-glanceclient-e976032a95962d6f6c750a7812ffda155492bc73.tar.gz
Remove usage of assert_called_once on Mock objects
mock 1.1.0 was released on 10 July 2015 which prevents users from using non-existent assertion methods. This broke the test in the diff. Co-Authored-By: Ian Cordasco <graffatcolmingov@gmail.com> Closes-Bug: #1473454 Change-Id: I162b76bbd7d96c96787a8dd8f9642ca1c80c596a
-rw-r--r--glanceclient/tests/unit/v2/test_shell_v2.py2
-rw-r--r--test-requirements.txt3
2 files changed, 3 insertions, 2 deletions
diff --git a/glanceclient/tests/unit/v2/test_shell_v2.py b/glanceclient/tests/unit/v2/test_shell_v2.py
index faaad01..5967b00 100644
--- a/glanceclient/tests/unit/v2/test_shell_v2.py
+++ b/glanceclient/tests/unit/v2/test_shell_v2.py
@@ -833,7 +833,7 @@ class ShellV2Test(testtools.TestCase):
test_shell.do_md_resource_type_list(self.gc, args)
- mocked_list.assert_called_once()
+ self.assertEqual(1, mocked_list.call_count)
def test_do_md_namespace_resource_type_list(self):
args = self._make_args({'namespace': 'MyNamespace'})
diff --git a/test-requirements.txt b/test-requirements.txt
index 2ef5e9a..ebf9fc0 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -5,7 +5,8 @@ hacking<0.11,>=0.10.0
coverage>=3.6
discover
-mock>=1.0
+mock>=1.0;python_version!='2.6'
+mock==1.0.1;python_version=='2.6'
oslosphinx>=2.5.0 # Apache-2.0
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
testrepository>=0.0.18