Commit Graph

16 Commits

Author SHA1 Message Date
Chris PeBenito
6d7a672611 Update static testing and fix identified issues.
* Change pep8 to new pycodestyle tool.
* Load the policrep extension in pylint
2018-08-11 20:46:06 -04:00
Chris PeBenito
2b4d69d42e Revise structure to make policyrep a module instead of a subpackage.
The setools.policyrep.exception module merged into setools.exception.
2018-08-11 20:46:01 -04:00
Chris PeBenito
dc3752e12d tests: Fix static analysis errors. 2018-06-15 20:26:49 -04:00
Chris PeBenito
51b91d6130 Convert policyrep and SWIG wrapper into Cython libpolicyrep. 2018-06-15 20:26:49 -04:00
Chris PeBenito
9fa55c25cb Update unit tests for Python 3 only use. 2017-09-19 20:58:03 -04:00
Chris PeBenito
b1c2901e4f tests: fix iter() use in Mock objects
By using return_value, there was only one instance of the iterator, which
would cause problems if it needed to be used again but had already been
consumed. Switch to lambdas that return a new instance of the iter().
2015-04-18 10:47:42 -04:00
Chris PeBenito
cc7ee08f03 policyrep factories: short circuit if provided a constructed object.
Change factory functions that support lookups to short circuit if they are
being provided an instance of the object they are meant to create.
2015-04-16 14:07:18 -04:00
Chris PeBenito
4e0b7d853b Thoroughly test MLS representations.
Implement category and level decl. lookups along the way.
2015-04-09 14:27:51 -04:00
Chris PeBenito
9d51dcc7e3 Misc cleanups suggested by pylint
* unnecessary parentheses on return
* variable shadowing
* unused variables
* classmethod variable naming
2015-04-02 14:50:21 -04:00
Chris PeBenito
c146f0ab47 Restructure exceptions across the entire project.
Group all exception classes into a module for each package.  This is the
first step towards having all exceptions raised by setools libs be a child of
SEToolsException.
2015-04-01 12:10:45 -04:00
Chris PeBenito
bb1734e9e5 RangeFactoryTest: add test for high end of range being invalid 2015-03-29 09:40:15 -04:00
Chris PeBenito
f2d334c691 LevelFactoryTest: add extra test for category range parse error.
Such as: s0:c0.c2.c4
2015-03-20 12:03:09 -04:00
Chris PeBenito
ed35d206d9 Change unit tests to use setUpClass for opening policies. 2015-03-18 09:44:16 -04:00
Chris PeBenito
46392c752b Add tests for MLS factory functions on MLS-disabled policy. 2015-03-15 15:01:46 -04:00
Chris PeBenito
f472d6c912 Break up tests in policrep/mls. 2015-02-28 10:59:53 -05:00
Chris PeBenito
a8d7f740b2 Change range constructor to use regular levels instead of semantic ones.
This affords better error reporting since levels can be invalid for
several reasons.

* Fix memory leak in qpol_semantic_level
* Add unit tests
2015-02-22 09:24:39 -05:00