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

Unified Diff: tests/conftest.py

Issue 29355396: Issue 4380 - Add Mock Crowdin API and Sync Test (Closed)
Patch Set: better assertions and expected request data added Created Oct. 19, 2016, 2:07 a.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 | « no previous file | tests/crowdin_mock_api.py » ('j') | tests/crowdin_mock_api.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/conftest.py
===================================================================
new file mode 100644
--- /dev/null
+++ b/tests/conftest.py
@@ -0,0 +1,18 @@
+import os
+import pytest
+import shutil
+import subprocess
+
+
+ROOTPATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+
+
+@pytest.fixture(scope='session')
+def temp_site(tmpdir_factory):
+ out_dir = tmpdir_factory.mktemp('temp_out')
+ site_dir = out_dir.join('test_site').strpath
+
+ shutil.copytree(os.path.join(ROOTPATH, 'tests', 'test_site'), site_dir)
+ subprocess.check_call(['hg', 'init', site_dir])
+ subprocess.check_call(['hg', '-R', site_dir, 'commit', '-A', '-m', 'foo'])
+ yield site_dir
« no previous file with comments | « no previous file | tests/crowdin_mock_api.py » ('j') | tests/crowdin_mock_api.py » ('J')

Powered by Google App Engine
This is Rietveld