magnum/HACKING.rst
indicoliteplus 37093b2436 Revert "Using assertFalse(A) instead of assertEqual(False, A)"
This is not correct,
because assertEqual(False, A) is a stricter check than assertFalse(A).

assertFalse(None) passes, but assertEqual(False, None) will fail.
Therefore, this patch weakened our tests.

Change-Id: I35c8978d8e189c894038b8d1e974938ffff71fcc
2017-06-15 12:46:54 +08:00

945 B

Magnum Style Commandments

Magnum Specific Commandments

  • [M302] Change assertEqual(A is not None) by optimal assert like assertIsNotNone(A).
  • [M310] timeutils.utcnow() wrapper must be used instead of direct calls to datetime.datetime.utcnow() to make it easy to override its return value.
  • [M316] Change assertTrue(isinstance(A, B)) by optimal assert like assertIsInstance(A, B).
  • [M322] Method's default argument shouldn't be mutable.
  • [M336] Must use a dict comprehension instead of a dict constructor with a sequence of key-value pairs.
  • [M338] Use assertIn/NotIn(A, B) rather than assertEqual(A in B, True/False).
  • [M339] Don't use xrange()
  • [M340] Check for explicit import of the _ function.
  • [M352] LOG.warn is deprecated. Enforce use of LOG.warning.