10 Commits

Author SHA1 Message Date
Bertrand Lallau
88a62cfecb Use assertIs(Not)None instead of assert(Not)Equal
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
2015-11-09 20:48:07 +01:00
Bertrand Lallau
76e1e02e15 Removes the use of mutables as default args
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
2015-11-09 09:42:32 +01:00
Bertrand Lallau
456a07f60a Update HACKING.rst to reflect real syntax checks
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
2015-11-07 21:37:33 +01:00
Bertrand Lallau
f7a540b156 Set Hacking rules to check some tests assert
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
2015-11-04 16:18:59 +01:00
Bertrand Lallau
734d61c51c Change assertTrue(isinstance()) by optimal assert
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
2015-10-27 22:32:06 +01:00
Stephen Balukoff
6d88d6a347 Fixing a couple minor terminology errors
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
2015-08-03 15:24:01 -07:00
Jorge Miramontes
7a3f947081 Added versioning and migration mandates
Updated HACKING.rst to include mandates
around API versioning and seamless migrations.

Change-Id: Iafb33d7a698b22a84a7b6167792e4d37aed110de
2014-12-05 17:37:38 -06:00
Brandon Logan
507ff77b29 Hacking fixes in CONSTITUTION, ROADMAP, & HACKING
Change-Id: I6f075284731139cd9611938178ee998ad3a075c0
2014-08-16 00:13:00 -05:00
Stephen Balukoff
3324e1219a Documenting project direction and design
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
2014-08-02 17:08:10 +00:00
Stephen Balukoff
f77df1766c Populate repository with common initial files
Every repo needs a first commit, eh? Most of this
is based on the neutron and neutron-specs project layouts.

Change-Id: I17a41fc30f8f8499c679afad14019c0755582bc6
2014-07-02 20:30:14 -07:00