2016-06-07 13:12:22 +05:30
|
|
|
Zun Style Commandments
|
|
|
|
======================
|
2016-05-11 18:01:24 -04:00
|
|
|
|
2017-07-14 17:07:14 +07:00
|
|
|
Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/
|
2016-05-20 11:30:28 +05:30
|
|
|
|
2016-06-07 13:12:22 +05:30
|
|
|
Zun Specific Commandments
|
|
|
|
-------------------------
|
2016-05-20 11:30:28 +05:30
|
|
|
|
2016-12-20 23:28:31 +05:30
|
|
|
- [Z302] Change assertEqual(A is not None) by optimal assert like
|
2016-05-20 11:30:28 +05:30
|
|
|
assertIsNotNone(A).
|
2016-12-20 23:28:31 +05:30
|
|
|
- [Z310] timeutils.utcnow() wrapper must be used instead of direct calls to
|
2016-05-20 11:30:28 +05:30
|
|
|
datetime.datetime.utcnow() to make it easy to override its return value.
|
2016-12-20 23:28:31 +05:30
|
|
|
- [Z316] Change assertTrue(isinstance(A, B)) by optimal assert like
|
2016-05-20 11:30:28 +05:30
|
|
|
assertIsInstance(A, B).
|
2016-12-20 23:28:31 +05:30
|
|
|
- [Z322] Method's default argument shouldn't be mutable.
|
|
|
|
- [Z323] Change assertEqual(True, A) or assertEqual(False, A) by optimal assert
|
2016-05-20 11:30:28 +05:30
|
|
|
like assertTrue(A) or assertFalse(A)
|
2016-12-20 23:28:31 +05:30
|
|
|
- [Z336] Must use a dict comprehension instead of a dict constructor
|
2016-05-20 11:30:28 +05:30
|
|
|
with a sequence of key-value pairs.
|
2016-12-20 23:28:31 +05:30
|
|
|
- [Z338] Use assertIn/NotIn(A, B) rather than assertEqual(A in B, True/False).
|
|
|
|
- [Z339] Don't use xrange()
|
2016-12-21 22:32:54 +08:00
|
|
|
- [Z352] LOG.warn is deprecated. Enforce use of LOG.warning.
|
2017-07-03 03:37:20 -04:00
|
|
|
- [Z353] Don't translate logs.
|