diff options
| author | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-12-08 04:43:13 +0000 |
|---|---|---|
| committer | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-12-08 04:43:13 +0000 |
| commit | 118dd3d2aa36cf563590197e28830c1a905f9cd8 (patch) | |
| tree | d60b440574557f4f0dfdb4494e5d37e6d52f2fdf /test/functional/tests | |
| parent | e571eb6f3616063e8cc1096b3451aa6f3e659858 (diff) | |
| download | docutils-118dd3d2aa36cf563590197e28830c1a905f9cd8.tar.gz | |
merged branches/s5 changes r4011:4155 into trunk/docutils
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@4156 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'test/functional/tests')
| -rwxr-xr-x | test/functional/tests/standalone_rst_s5_html_1.py | 44 | ||||
| -rwxr-xr-x | test/functional/tests/standalone_rst_s5_html_2.py | 7 |
2 files changed, 51 insertions, 0 deletions
diff --git a/test/functional/tests/standalone_rst_s5_html_1.py b/test/functional/tests/standalone_rst_s5_html_1.py new file mode 100755 index 000000000..cb0d6f552 --- /dev/null +++ b/test/functional/tests/standalone_rst_s5_html_1.py @@ -0,0 +1,44 @@ +execfile('functional/tests/_standalone_rst_defaults.py') + +# Source and destination file names: +test_source = 'standalone_rst_s5_html.txt' +test_destination = 'standalone_rst_s5_html_1.html' + +# Keyword parameters passed to publish_file: +writer_name = 's5_html' + +# Settings: +settings_overrides['theme'] = 'small-black' + + +# Extra functional tests. +# Prefix all names with '_' to avoid confusing `docutils.core.publish_file`. + +import filecmp as _filecmp + +def _test_more(expected_dir, output_dir, test_case, parameters): + """Compare ``ui/<theme>`` directories.""" + theme = settings_overrides.get('theme', 'default') + expected = '%s/%s/%s' % (expected_dir, 'ui', theme) + output = '%s/%s/%s' % (output_dir, 'ui', theme) + differences, uniques = _compare_directories(expected, output) + parts = [] + if differences: + parts.append('The following files differ from the expected output:') + parts.extend(differences) + if uniques: + parts.append('The following paths are unique:') + parts.extend(uniques) + test_case.assert_(not parts, '\n'.join(parts)) + +def _compare_directories(expected, output): + dircmp = _filecmp.dircmp(expected, output, ['.svn', 'CVS']) + differences = ['%s/%s' % (output, name) for name in dircmp.diff_files] + uniques = (['%s/%s' % (expected, name) for name in dircmp.left_only] + + ['%s/%s' % (output, name) for name in dircmp.right_only]) + for subdir in dircmp.common_dirs: + diffs, uniqs = _compare_directories('%s/%s' % (expected, subdir), + '%s/%s' % (output, subdir)) + differences.extend(diffs) + uniques.extend(uniqs) + return differences, uniques diff --git a/test/functional/tests/standalone_rst_s5_html_2.py b/test/functional/tests/standalone_rst_s5_html_2.py new file mode 100755 index 000000000..aea7a9207 --- /dev/null +++ b/test/functional/tests/standalone_rst_s5_html_2.py @@ -0,0 +1,7 @@ +# initialize with the settings & definitions from test 1: +execfile('functional/tests/standalone_rst_s5_html_1.py') + +# overrides specific to this test: +test_destination = 'standalone_rst_s5_html_2.html' +del settings_overrides['theme'] # use the default +settings_overrides['current_slide'] = 1 |
