-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ad3d4a
commit 5c3bab9
Showing
3 changed files
with
79 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import filecmp | ||
import os | ||
import pathlib | ||
import shutil | ||
|
||
from tests.test_tools import testing | ||
|
||
from incipyt import __main__ | ||
|
||
|
||
def make_archive(): | ||
runner = testing.IncipytRunner() | ||
root_dir = pathlib.Path(__file__).parent | ||
with runner.isolated_filesystem() as td: | ||
runner.invoke(__main__.main, ["--vcs=git", "--check-build", "my_project"]) | ||
os.chdir(root_dir) | ||
os.remove("git.tar.gz") | ||
shutil.make_archive("git", "gztar", root_dir=td, base_dir="my_project") | ||
|
||
|
||
def test_integration(tmp_path): | ||
runner = testing.IncipytRunner(input_mapping={r"Repository": ""}) | ||
with runner.isolated_filesystem(temp_dir=tmp_path): | ||
result = runner.invoke( | ||
__main__.main, ["--vcs=git", "--check-build", "my_project"] | ||
) | ||
shutil.unpack_archive(pathlib.Path(__file__).parent / "git.tar.gz", "archive") | ||
diff = testing.diff_files( | ||
filecmp.dircmp("my_project", pathlib.Path("archive/my_project")) | ||
) | ||
|
||
assert diff == set() | ||
assert not result.exception | ||
assert result.exit_code == 0 |