@@ 89-104 (lines=16) @@ | ||
86 | assert os.path.exists(output_path) |
|
87 | assert result.exit_code == 0 |
|
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 | def test_metadata_reserved_key(git_repo): |
|
107 | runner = CliRunner() |
|
@@ 73-87 (lines=15) @@ | ||
70 | assert os.path.exists(output_path) |
|
71 | ||
72 | ||
73 | def test_json(git_repo): |
|
74 | runner = CliRunner() |
|
75 | ||
76 | arg = [git_repo.working_tree_dir] |
|
77 | output_path = os.path.join(git_repo.working_tree_dir, 'version.json') |
|
78 | ||
79 | result = runner.invoke(git_app_version_main, arg) |
|
80 | ||
81 | assert result.output.find('Git commit :') != -1 |
|
82 | assert re.search(r"version\s+0.1.2", result.output) |
|
83 | assert result.output.find('written to :') != -1 |
|
84 | assert result.output.find(output_path) != -1 |
|
85 | ||
86 | assert os.path.exists(output_path) |
|
87 | assert result.exit_code == 0 |
|
88 | ||
89 | def test_metadata(git_repo): |
|
90 | runner = CliRunner() |