
* Related to I579e7c889f3addc2cd40bce0c584bbc70bf435e2 * Remove section on locals since its already in global hacking doc (http://git.openstack.org/cgit/openstack-dev/hacking/tree/doc/source/index.rst#n154) Change-Id: I5acb06dfde6eb7f579d8d52bc31fafbdab8c726d
35 lines
990 B
ReStructuredText
35 lines
990 B
ReStructuredText
Cinder Style Commandments
|
|
=========================
|
|
|
|
- Step 1: Read the OpenStack Style Commandments
|
|
http://docs.openstack.org/developer/hacking/
|
|
- Step 2: Read on
|
|
|
|
Cinder Specific Commandments
|
|
----------------------------
|
|
|
|
General
|
|
-------
|
|
- Use 'raise' instead of 'raise e' to preserve original traceback or exception being reraised::
|
|
|
|
except Exception as e:
|
|
...
|
|
raise e # BAD
|
|
|
|
except Exception:
|
|
...
|
|
raise # OKAY
|
|
|
|
|
|
|
|
Creating Unit Tests
|
|
-------------------
|
|
For every new feature, unit tests should be created that both test and
|
|
(implicitly) document the usage of said feature. If submitting a patch for a
|
|
bug that had no unit test, a new passing unit test should be added. If a
|
|
submitted bug fix does have a unit test, be sure to add a new one that fails
|
|
without the patch and passes with the patch.
|
|
|
|
For more information on creating unit tests and utilizing the testing
|
|
infrastructure in OpenStack Cinder, please read cinder/testing/README.rst.
|