* unittests more important than suggestions
This commit is contained in:
+25
-21
@@ -9,9 +9,32 @@ Guidelines
|
|||||||
in pisiconfig
|
in pisiconfig
|
||||||
2. Python indentation is usually 4 chars.
|
2. Python indentation is usually 4 chars.
|
||||||
3. Follow python philosophy of 'batteries included'
|
3. Follow python philosophy of 'batteries included'
|
||||||
|
4. Don't make the code have runtime dependencies on
|
||||||
|
a particular distribution (as much as possible)
|
||||||
|
|
||||||
|
Unittests
|
||||||
|
---------
|
||||||
|
|
||||||
|
Unittests are located in unittests directory. Running the tests are
|
||||||
|
trivial. But you must syncronize your code and data with the test
|
||||||
|
code, which can be a tedious work if you lose discipline.
|
||||||
|
|
||||||
|
Sample data files are located in samples/ directory.
|
||||||
|
|
||||||
|
For running all test suites, use the following command:
|
||||||
|
|
||||||
|
$ ./unittests/run.py
|
||||||
|
|
||||||
|
If you know what you are doing, you can run the tests seperately. But
|
||||||
|
keep in your mind that test can depend each other. The following
|
||||||
|
command will run tests in specfiletests and archivetests:
|
||||||
|
|
||||||
|
$ ./unittests/run.py specfiletests archivetests
|
||||||
|
|
||||||
|
|
||||||
|
Misc. Suggestions
|
||||||
|
-----------------
|
||||||
|
|
||||||
Suggestions
|
|
||||||
------------
|
|
||||||
In OO programming, try to invoke Demeter's law.
|
In OO programming, try to invoke Demeter's law.
|
||||||
One of the "rules" there is not directly accessing any
|
One of the "rules" there is not directly accessing any
|
||||||
objects that are further than, 2/3 refs, away. So the
|
objects that are further than, 2/3 refs, away. So the
|
||||||
@@ -43,22 +66,3 @@ The main rule of thumb in Demeter's Law is avoiding
|
|||||||
putting more than, say, 10 methods in a class. That works
|
putting more than, say, 10 methods in a class. That works
|
||||||
really well in practice, forcing refactoring every now
|
really well in practice, forcing refactoring every now
|
||||||
and then.
|
and then.
|
||||||
|
|
||||||
Unittests
|
|
||||||
---------
|
|
||||||
Unittests are located in unittests directory. Running the tests are
|
|
||||||
trivial. But you must syncronize your code and data with the test
|
|
||||||
code, which can be a tedious work if you lose discipline.
|
|
||||||
|
|
||||||
Sample data files are located in samples/ directory.
|
|
||||||
|
|
||||||
For running all test suites, use the following command:
|
|
||||||
|
|
||||||
$ ./unittests/run.py
|
|
||||||
|
|
||||||
If you know what you are doing, you can run the tests seperately. But
|
|
||||||
keep in your mind that test can depend each other. The following
|
|
||||||
command will run tests in specfiletests and archivetests:
|
|
||||||
|
|
||||||
$ ./unittests/run.py specfiletests archivetests
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user