-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor tests to remove the embedded git #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
7c1cfab
0d8a860
9951eba
0a1396f
242866e
b018325
fb81746
89162b5
f03ec24
d2fd475
cccdc4c
3248cd6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,9 @@ | ||
| import os | ||
| from pathlib import Path | ||
| import pytest | ||
| import subprocess | ||
| from genericpath import exists | ||
|
|
||
|
|
||
| # Fixture to run test in current tmp_path | ||
| @pytest.fixture | ||
|
|
@@ -15,7 +18,21 @@ def git2cpp_path(): | |
| return Path(__file__).parent.parent / 'build' / 'git2cpp' | ||
|
|
||
| @pytest.fixture | ||
| def rename_git(): | ||
| os.rename("test/data/status_data/embedded_git/", "test/data/status_data/.git/") | ||
| def xtl_clone(git2cpp_path): | ||
| url = 'https://github.com/xtensor-stack/xtl.git' | ||
| clone_working_dir = 'test/data' | ||
|
|
||
| clone_cmd = [git2cpp_path, 'clone', url] | ||
| subprocess.run(clone_cmd, capture_output=True, cwd = clone_working_dir, text=True) | ||
|
|
||
| yield | ||
| os.rename("test/data/status_data/.git/", "test/data/status_data/embedded_git/") | ||
|
|
||
| cleanup_cmd = ['rm', '-rf', 'xtl'] | ||
| subprocess.run(cleanup_cmd, capture_output=True, cwd = clone_working_dir, text=True) | ||
|
|
||
| @pytest.fixture | ||
| def git_config(git2cpp_path, monkeypatch): | ||
ianthomas23 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| monkeypatch.setenv("GIT_AUTHOR_NAME", "Jane Doe") | ||
| monkeypatch.setenv("GIT_AUTHOR_EMAIL", "[email protected]") | ||
| monkeypatch.setenv("GIT_COMMITTER_NAME", "Jane Doe") | ||
| monkeypatch.setenv("GIT_COMMITTER_EMAIL", "[email protected]") | ||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.