Instead of using assert(Not)Equal(None, ***), developers should
use assertIs(Not)None(***) to have more clear messages in case of failure.
Change-Id: I20dd008badde8a3e87a367e7ab791ace4e117fb7
Passing mutable objects as default args is a known Python pitfall.
We'd better avoid this. This commit changes mutable default args with
None, then use 'arg = arg or {}', 'arg = arg or []'. For unit code which
doesn't use the args , just set with None. This commit also adds hacking
check.
Change-Id: Ib4f195c9c00ca2c49579f9d62648bff7c8109fcf
Closes-Bug: #1327473
In the past HACKING.rst file has not been updated when needed,
this patch update HACKING.rst file for all missing syntax checks.
Furthermore rules checks have been reorder in octavia/hacking/checks.py file.
Change-Id: I34bdcca5d4cc9abad797aff118fbf4e563c42757
Octavia doesn't have hacking rules to check "assert" usages like:
- assertTrue(isinstance(A, class A))
- assertEqual(A, None) or assertEqual(None, A)
- assertEqual(False, A) or assertEqual(True, A)
- assertEqual(a in b, True) or assertEqual(a in b, False)
This patch introduce hacking rules just above.
Change-Id: If64402508226608b5700c8bb11e924dbc778fec3
Closes-Bug: #1511368
Some of tests use different method of assertTrue(isinstance(A, B)) or
assertEqual(type(A), B). The correct way is to use assertIsInstance(A,
B) provided by testtools.
Change-Id: I2ce6f9afeaf2c55fb781d3ba397cb8f7cbf8b686
Since I'm updating documentation anyway, and as these fixes don't
fit well into v1 or v2 design documents, I figured a small commit
here to correct the 'VM' terminology to be 'amphora' where
appropriate is called for.
Change-Id: I5f62f9fb62534f48de3d761c64419c08c66fed64
This commit adds documentation around project direction and conventions.
Additionally, I've added doc8 checks to make sure or .rst and .txt files
in this repository follow good conventions, and fixed a check related to
graphviz external .dot files.
Change-Id: I1b73b3839b86198f3d56587ca3fb2644dc231f00
Every repo needs a first commit, eh? Most of this
is based on the neutron and neutron-specs project layouts.
Change-Id: I17a41fc30f8f8499c679afad14019c0755582bc6