From 8d3c2ce92bcaf8cf777bf29fd46275572da61547 Mon Sep 17 00:00:00 2001 From: Takashi Natsume Date: Mon, 28 Sep 2020 22:35:00 +0900 Subject: Add a hacking rule for assert_has_calls Add the following hacking rule. * N366: The assert_has_calls is a method rather than a variable. Not correct: mock_method.assert_has_calls = [mock.call(0)] Correct: mock_method.assert_has_calls([mock.call(0)]) This patch is a follow-up patch for Id094dd90efde09b9a835d4492f4a92b8f8ad296e. Change-Id: I892f8c23ee44f2b3518776a9705e3543f3115cae Signed-off-by: Takashi Natsume --- HACKING.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'HACKING.rst') diff --git a/HACKING.rst b/HACKING.rst index 6678328fd2..76ff4b6c22 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -67,6 +67,7 @@ Nova Specific Commandments - [N363] Disallow ``(not_a_tuple)`` because you meant ``(a_tuple_of_one,)``. - [N364] Check non-existent mock assertion methods and attributes. - [N365] Check misuse of assertTrue/assertIsNone. +- [N366] The assert_has_calls is a method rather than a variable. Creating Unit Tests ------------------- -- cgit v1.2.1