Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: cms/tests/static_tests/test_module.py

Issue 29345468: Issue 4045 - Add Test Suite To CMS (Closed)
Patch Set: CMS Test Suite Conf and Some Tests Created June 29, 2016, 1:13 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cms/tests/static_tests/conftest.py ('k') | cms/tests/test_site/pages/filter.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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]
« no previous file with comments | « cms/tests/static_tests/conftest.py ('k') | cms/tests/test_site/pages/filter.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld