test direcitve_class variable existence
ClosedPublic

Authored by lbrabec on Jul 24 2014, 8:44 AM.

Details

Summary

New unit test that iterates through all available directives and checks that all directive_class variables are valid.

Test Plan

$ py.test

Diff Detail

Repository
rLTRN libtaskotron
Lint
Lint Skipped
Unit
Unit Tests Skipped
lbrabec retitled this revision from to test direcitve_class variable existence.Jul 24 2014, 8:44 AM
lbrabec updated this object.
lbrabec edited the test plan for this revision. (Show Details)
lbrabec added a reviewer: kparal.

Josef, could you give us an advice here, whether it is cleaner to list all .py files in a given directory, or use a different approach like this?
http://stackoverflow.com/questions/1707709/list-all-the-modules-that-are-part-of-a-python-package/1707786#1707786

Any preference to using __import__ or imp?

Preliminary review.

Could you please rename testing/test_directive_class_vars.py into something like testing/test_directives.py? In future we might want to add additional generic directives tests and it would be silly create separate modules for each such test. Let's name this test module in a generic way.

testing/test_directive_class_vars.py
12–13 ↗(On Diff #558)

Please document either under the class or under the method the intended behavior that you are testing. This is something that's not immediately clear from the method name. Something like:

Every directive module must contain a global variable named ... and containing value ...

17 ↗(On Diff #558)

Please use [:-len('.py')] instead of [:-3]. It's much clearer what you're stripping and why.

lbrabec updated this revision to Diff 565.Jul 29 2014, 8:24 AM
  • polishing
lbrabec updated this revision to Diff 566.Jul 29 2014, 8:41 AM
  • oops, name problem fix
lbrabec updated this revision to Diff 567.Jul 29 2014, 1:03 PM
  • more tests
lbrabec updated this revision to Diff 568.Jul 29 2014, 2:16 PM
  • polishing 2
kparal accepted this revision.Jul 29 2014, 2:34 PM

Looks OK, please push.

This revision is now accepted and ready to land.Jul 29 2014, 2:34 PM
lbrabec closed this revision.Jul 30 2014, 11:49 AM
lbrabec updated this revision to Diff 571.

Closed by commit rLTRNbad02425649e (authored by @lbrabec).