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

Unified Diff: tests/test_page_outputs.py

Issue 29659605: Issue 6231 - Add tests for translation string substitution (Closed)
Patch Set: Add tests for partial translation and for get_string Created Jan. 19, 2018, 3:26 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 | « tests/expected_output/en/translate-tmpl ('k') | tests/test_site/includes/included-translations.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/test_page_outputs.py
===================================================================
--- a/tests/test_page_outputs.py
+++ b/tests/test_page_outputs.py
@@ -50,22 +50,25 @@
@pytest.fixture(scope='session')
def output_pages(static_output):
return get_dir_contents(static_output)
@pytest.mark.parametrize('filename,expected_output', static_expected_outputs)
def test_static(output_pages, filename, expected_output):
- assert output_pages[filename] == expected_output
+ if expected_output.startswith('## MISSING'):
Vasily Kuznetsov 2018/01/19 15:34:29 This allows us to check that a certain file _is_no
Jon Sonesen 2018/01/19 19:25:35 Acknowledged.
+ assert filename not in output_pages
+ else:
+ assert expected_output == output_pages[filename]
@pytest.mark.parametrize('filename,expected_output', dynamic_expected_outputs)
def test_dynamic(dynamic_server, filename, expected_output):
response = urllib2.urlopen(dynamic_server + filename)
- assert response.read().strip() == expected_output
+ assert expected_output == response.read().strip()
Vasily Kuznetsov 2018/01/19 15:34:29 I changed the order of arguments in a comparison t
Jon Sonesen 2018/01/19 19:25:35 Acknowledged.
def test_revision_arg(revision, output_pages):
if revision is None:
assert 'en/bar' in output_pages
else:
assert 'en/bar' not in output_pages
« no previous file with comments | « tests/expected_output/en/translate-tmpl ('k') | tests/test_site/includes/included-translations.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld