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