Added hacking rule for assertEqual(a in b, True/False).

The following replacements were done in tests to have
clearer messages in case of failure:
- assertEqual(a in b, True) with assertIn(a, b)
- assertEqual(a in b, False) with assertNotIn(a, b)

The error message would now be like:
   'abc' not in ['a', 'b', 'c']
rather than:
   MismatchError: False != True

Change-Id: I514daca3a470feef5d332a1a319cba15256fc6ea
This commit is contained in:
Sergey Nikitin 2014-10-23 16:32:33 +04:00
parent 87dc455b4b
commit 9c7932d39f
1 changed files with 3 additions and 0 deletions

View File

@ -49,6 +49,9 @@ Nova Specific Commandments
- [N335] Check for usage of deprecated assertRaisesRegexp
- [N336] Must use a dict comprehension instead of a dict constructor with a sequence of key-value pairs.
- [N337] Don't import translation in tests
- [N338] Change assertEqual(A in B, True), assertEqual(True, A in B),
assertEqual(A in B, False) or assertEqual(False, A in B) to the more specific
assertIn/NotIn(A, B)
Creating Unit Tests
-------------------