summaryrefslogtreecommitdiff
path: root/HACKING.rst
diff options
context:
space:
mode:
authorDavanum Srinivas <dims@linux.vnet.ibm.com>2014-09-15 21:23:58 -0400
committerDavanum Srinivas <dims@linux.vnet.ibm.com>2014-09-16 16:38:49 -0400
commit45553a6dda84ef6be38150071f8bb6fa9850a53e (patch)
tree13e0c02791f0fa7a7e11db16cfc8b2bac4a9a214 /HACKING.rst
parent51fff2459356a484b190d5610e4f2c953fdb59ac (diff)
downloadnova-45553a6dda84ef6be38150071f8bb6fa9850a53e.tar.gz
mock.assert_called_once() is not a valid method
mock.assert_called_once() is a no-op that tests nothing. Instead with mock.assert_called_once_with() should be used (or use assertEqual(1, mock_obj.call_count) if you don't want to check parameters). Add a new HACKING rule for nova to prevent assert_called_once() usage from creeping in. Closes-Bug: #1365751 Change-Id: I1055093a1c31792b6411a3cd46c80b8bcaaf78c1
Diffstat (limited to 'HACKING.rst')
-rw-r--r--HACKING.rst1
1 files changed, 1 insertions, 0 deletions
diff --git a/HACKING.rst b/HACKING.rst
index c32b6db093..f1a7f1ed1b 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -39,6 +39,7 @@ Nova Specific Commandments
- [N324] Ensure that jsonutils.%(fun)s must be used instead of json.%(fun)s
- [N325] str() cannot be used on an exception. Remove use or use six.text_type()
- [N326] Translated messages cannot be concatenated. String should be included in translated message.
+- [N327] assert_called_once() is not a valid method
Creating Unit Tests
-------------------