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

Side by Side Diff: tests/conftest.py

Issue 29472555: Issue 4867 - Add global get_pages_metadata to template converters (Closed)
Patch Set: Created June 23, 2017, 9:54 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 import os 1 import os
2 import pytest 2 import pytest
3 import shutil 3 import shutil
4 import subprocess 4 import subprocess
5 5
6 6
7 ROOTPATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 7 ROOTPATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
8 8
9 9
10 @pytest.fixture(scope='session') 10 @pytest.fixture(scope='session')
11 def temp_site(tmpdir_factory): 11 def temp_site(tmpdir_factory):
12 out_dir = tmpdir_factory.mktemp('temp_out') 12 out_dir = tmpdir_factory.mktemp('temp_out')
13 site_dir = out_dir.join('test_site').strpath 13 site_dir = out_dir.join('test_site').strpath
14 14
15 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir) 15 shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir)
16 subprocess.check_call(['hg', 'init', site_dir]) 16 subprocess.check_call(['hg', 'init', site_dir])
17 subprocess.check_call(['hg', '-R', site_dir, 'commit', '-A', '-m', 'foo']) 17 subprocess.check_call(['hg', '-R', site_dir, 'commit', '-A', '-m', 'foo'])
18 18
19 subprocess.check_call(['hg', '-R', site_dir, 'bookmark', 'master']) 19 subprocess.check_call(['hg', '-R', site_dir, 'bookmark', 'master'])
20 subprocess.check_call(['hg', '-R', site_dir, 'bookmark', 'test']) 20 subprocess.check_call(['hg', '-R', site_dir, 'bookmark', 'test'])
21 subprocess.check_call(['touch', os.path.join(site_dir, 'pages', 'bar.md')]) 21 subprocess.check_call(['touch', os.path.join(site_dir, 'templates',
22 'bar.md')])
Jon Sonesen 2017/06/23 10:09:26 I modified the bookmark to introduce a template ra
22 subprocess.check_call(['hg', '-R', site_dir, 'commit', '-A', '-m', 'bar']) 23 subprocess.check_call(['hg', '-R', site_dir, 'commit', '-A', '-m', 'bar'])
23 yield site_dir 24 yield site_dir
OLDNEW

Powered by Google App Engine
This is Rietveld