Closed leotrs closed 8 years ago
Could you add this to makefile
so that running make test
will run these unit tests and fail if they fail?
Looks like you need to add the from __future__
imports to the test cases.
Using this import in test.py
passes all tests:
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
It's not pretty, but given that StringIO
is only being used in the test suite, it makes sense to branch an import based on python version.
Thank you!
Before working on another PR, I wanted to implement some basic tests.
test/test.py
implements one test for each module, plus one for thereadme.mdpp
file, using theunittest
package.test/test_include.py
is a dummy file used in tests.Modules/IncludeURL.py
was necessary in order to make the!INCLUDEURL
directive accept uris of the formfile://path_to_local_file
(used intest.test_include_url
). Of course, including local files is not the point of IncludeURL, but it seemed like a small enough change to make the test work. Furthermore, I couldn't think of a good static url that would always reliably return the same text, so I settled for including a local file.