Index: cms/tests/static_tests/test_module.py |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/cms/tests/static_tests/test_module.py |
@@ -0,0 +1,25 @@ |
+import os |
+ |
+ |
+class TestStatic: |
+ @classmethod |
+ def generate_static_test_pages(cls): |
+ import subprocess |
+ import runpy |
+ import sys |
+ sys.path.insert(0, '../') |
+ subprocess.call(['hg', 'init', 'cms/tests/test_site']) |
+ subprocess.call(['hg', '-R', 'cms/tests/test_site', 'add']) |
+ subprocess.call(['hg', '-R', 'cms/tests/test_site', 'commit', |
+ '-m', 'test']) |
+ sys.argv = ['filler', 'cms/tests/test_site', 'cms/tests/static_out'] |
+ runpy.run_module('cms.bin.generate_static_pages', run_name='__main__') |
+ |
+ def test_extension_removed(self, input_files, output_files): |
+ for key in input_files.keys(): |
+ assert key not in output_files |
+ |
+ def test_template(self, input_files, output_files): |
+ for key in input_files.keys(): |
+ cleankey = os.path.splitext(key)[0] |
+ assert input_files[key] != output_files[cleankey] |