|
@@ 89-104 (lines=16) @@
|
| 86 |
|
assert result.exit_code == 0 |
| 87 |
|
|
| 88 |
|
|
| 89 |
|
def test_metadata(git_repo): |
| 90 |
|
runner = CliRunner() |
| 91 |
|
|
| 92 |
|
arg = ['-m', 'foo=bar', '-m', 'desc=custom', git_repo.working_tree_dir] |
| 93 |
|
output_path = os.path.join(git_repo.working_tree_dir, 'version.json') |
| 94 |
|
|
| 95 |
|
result = runner.invoke(git_app_version_main, arg) |
| 96 |
|
|
| 97 |
|
assert result.output.find('Git commit :') != -1 |
| 98 |
|
assert re.search(r"version\s+0.1.2", result.output) |
| 99 |
|
assert re.search(r"foo\s+bar", result.output) |
| 100 |
|
assert re.search(r"desc\s+custom", result.output) |
| 101 |
|
assert result.output.find(output_path) != -1 |
| 102 |
|
|
| 103 |
|
assert os.path.exists(output_path) |
| 104 |
|
assert result.exit_code == 0 |
| 105 |
|
|
| 106 |
|
|
| 107 |
|
def test_metadata_reserved_key(git_repo): |
|
@@ 73-87 (lines=15) @@
|
| 70 |
|
|
| 71 |
|
|
| 72 |
|
def test_json(git_repo): |
| 73 |
|
runner = CliRunner() |
| 74 |
|
|
| 75 |
|
arg = [git_repo.working_tree_dir] |
| 76 |
|
output_path = os.path.join(git_repo.working_tree_dir, 'version.json') |
| 77 |
|
|
| 78 |
|
result = runner.invoke(git_app_version_main, arg) |
| 79 |
|
|
| 80 |
|
assert result.output.find('Git commit :') != -1 |
| 81 |
|
assert re.search(r"version\s+0.1.2", result.output) |
| 82 |
|
assert result.output.find('written to :') != -1 |
| 83 |
|
assert result.output.find(output_path) != -1 |
| 84 |
|
|
| 85 |
|
assert os.path.exists(output_path) |
| 86 |
|
assert result.exit_code == 0 |
| 87 |
|
|
| 88 |
|
|
| 89 |
|
def test_metadata(git_repo): |
| 90 |
|
runner = CliRunner() |