Now packaging 8.0.0~b2
[openstack-build/neutron-build.git] / HACKING.rst
1 Neutron Style Commandments
2 =======================
3
4 - Step 1: Read the OpenStack Style Commandments
5   http://docs.openstack.org/developer/hacking/
6 - Step 2: Read on
7
8 Neutron Specific Commandments
9 --------------------------
10
11 - [N319] Validate that debug level logs are not translated
12 - [N320] Validate that LOG messages, except debug ones, have translations
13 - [N321] Validate that jsonutils module is used instead of json
14 - [N322] Detect common errors with assert_called_once_with
15 - [N323] Enforce namespace-less imports for oslo libraries
16 - [N324] Prevent use of deprecated contextlib.nested.
17 - [N325] Python 3: Do not use xrange.
18 - [N326] Python 3: do not use basestring.
19 - [N327] Python 3: do not use dict.iteritems.
20 - [N328] Detect wrong usage with assertEqual
21 - [N329] Method's default argument shouldn't be mutable
22
23 Creating Unit Tests
24 -------------------
25 For every new feature, unit tests should be created that both test and
26 (implicitly) document the usage of said feature. If submitting a patch for a
27 bug that had no unit test, a new passing unit test should be added. If a
28 submitted bug fix does have a unit test, be sure to add a new one that fails
29 without the patch and passes with the patch.
30
31 All unittest classes must ultimately inherit from testtools.TestCase. In the
32 Neutron test suite, this should be done by inheriting from
33 neutron.tests.base.BaseTestCase.
34
35 All setUp and tearDown methods must upcall using the super() method.
36 tearDown methods should be avoided and addCleanup calls should be preferred.
37 Never manually create tempfiles. Always use the tempfile fixtures from
38 the fixture library to ensure that they are cleaned up.