summaryrefslogtreecommitdiff
path: root/openstackclient/tests
diff options
context:
space:
mode:
authorlin-hua-cheng <os.lcheng@gmail.com>2015-07-10 00:11:18 -0700
committerSteve Martinelli <stevemar@ca.ibm.com>2015-07-11 18:57:20 -0400
commitf807f0a66e2d53b6711937a3687d44f11dc1d6fd (patch)
tree26de6810bd6f04eb5603a5926c9314a395786997 /openstackclient/tests
parent35dc2bed9ea802f577fd1ce7b3eadd1e18f5772a (diff)
downloadpython-openstackclient-f807f0a66e2d53b6711937a3687d44f11dc1d6fd.tar.gz
Fix wrong mock method call
There is no assert_called() method in mock, replace it with assert_called_with() method. The old method used to work with mock 1.0.1 because it was a noop in magicmock. Needs https://review.openstack.org/#/c/200583 to pass the requirements check. https://review.openstack.org/#/c/193935/ changed the OS_* vars we source by forcing v2password as the auth method. change our identity v3 test setup by setting v3password Co-Authored-By: Steve Martinelli <stevemar@ca.ibm.com> Closes-Bug: 1473454 Depends-on: I0cfab6d13e5d9e744cb302c86a2c21269923e75d Change-Id: Id22765c7e044797e03d19ad1b103fadec2726aa2
Diffstat (limited to 'openstackclient/tests')
-rw-r--r--openstackclient/tests/compute/v2/test_server.py2
-rw-r--r--openstackclient/tests/volume/v1/test_qos_specs.py2
-rw-r--r--openstackclient/tests/volume/v2/test_qos_specs.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/openstackclient/tests/compute/v2/test_server.py b/openstackclient/tests/compute/v2/test_server.py
index a8a1936d..c80b0084 100644
--- a/openstackclient/tests/compute/v2/test_server.py
+++ b/openstackclient/tests/compute/v2/test_server.py
@@ -250,7 +250,7 @@ class TestServerCreate(TestServer):
mock_open.assert_called_with('userdata.sh')
# Ensure the userdata file is closed
- mock_file.close.assert_called()
+ mock_file.close.assert_called_with()
# Set expected values
kwargs = dict(
diff --git a/openstackclient/tests/volume/v1/test_qos_specs.py b/openstackclient/tests/volume/v1/test_qos_specs.py
index 0a5d14e6..226fe673 100644
--- a/openstackclient/tests/volume/v1/test_qos_specs.py
+++ b/openstackclient/tests/volume/v1/test_qos_specs.py
@@ -312,7 +312,7 @@ class TestQosList(TestQos):
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
- self.qos_mock.list.assert_called()
+ self.qos_mock.list.assert_called_with()
collist = (
'ID',
diff --git a/openstackclient/tests/volume/v2/test_qos_specs.py b/openstackclient/tests/volume/v2/test_qos_specs.py
index 92b3f179..6a550988 100644
--- a/openstackclient/tests/volume/v2/test_qos_specs.py
+++ b/openstackclient/tests/volume/v2/test_qos_specs.py
@@ -312,7 +312,7 @@ class TestQosList(TestQos):
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
- self.qos_mock.list.assert_called()
+ self.qos_mock.list.assert_called_with()
collist = (
'ID',