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

Delta Between Two Patch Sets: tests/test_page_outputs.py

Issue 29805580: Issue 6728 - Remove Mercurial dependency (Closed)
Left Patch Set: Address PS2 comments Created June 15, 2018, 5:19 p.m.
Right Patch Set: Address PS4 comment Created July 9, 2018, 6:13 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « tests/test_additional_paths.py ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 import os 1 import os
2 import sys 2 import sys
3 import runpy 3 import runpy
4 4
5 import mock 5 import mock
6 import pytest 6 import pytest
7 import urllib2 7 import urllib2
8 8
9 from .conftest import ROOTPATH 9 from .conftest import ROOTPATH
10 from .utils import get_dir_contents, run_test_server 10 from .utils import get_dir_contents, run_test_server
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 @pytest.fixture(scope='session') 50 @pytest.fixture(scope='session')
51 def output_pages(static_output): 51 def output_pages(static_output):
52 return get_dir_contents(static_output) 52 return get_dir_contents(static_output)
53 53
54 54
55 @pytest.mark.parametrize('filename,expected_output', static_expected_outputs) 55 @pytest.mark.parametrize('filename,expected_output', static_expected_outputs)
56 def test_static(output_pages, filename, expected_output): 56 def test_static(output_pages, filename, expected_output):
57 if expected_output.startswith('## MISSING'): 57 if expected_output.startswith('## MISSING'):
58 assert filename not in output_pages 58 assert filename not in output_pages
59 return 59 else:
60 assert expected_output == output_pages[filename] 60 assert expected_output == output_pages[filename]
61 61
62 62
63 @pytest.mark.parametrize('filename,expected_output', dynamic_expected_outputs) 63 @pytest.mark.parametrize('filename,expected_output', dynamic_expected_outputs)
64 def test_dynamic(dynamic_server, filename, expected_output): 64 def test_dynamic(dynamic_server, filename, expected_output):
65 response = urllib2.urlopen(dynamic_server + filename) 65 response = urllib2.urlopen(dynamic_server + filename)
66 assert expected_output == response.read().strip() 66 assert expected_output == response.read().strip()
67 67
68 68
69 def test_cache(output_pages): 69 def test_cache(output_pages):
70 source = FileSource(os.path.join('tests', 'test_site')) 70 source = FileSource(os.path.join('test_site'))
Vasily Kuznetsov 2018/07/03 08:50:24 Nit: It seems like having "tests/test_site" as bas
jsonesen 2018/07/05 18:58:31 Acknowledged.
71 assert source.get_cache_dir() == os.path.join('tests', 71 assert source.get_cache_dir() == os.path.join('test_site', 'cache')
72 'test_site', 'cache')
LEFTRIGHT

Powered by Google App Engine
This is Rietveld