mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-17 05:15:19 +00:00
test: rename & add error case
This commit is contained in:
parent
ae633b3cea
commit
5e5ead98de
1 changed files with 10 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ class TestGitHubOutput:
|
||||||
assert not os.path.exists(str(tmp_path / 'output'))
|
assert not os.path.exists(str(tmp_path / 'output'))
|
||||||
|
|
||||||
def test_github_action_output_notset(self, monkeypatch, tmp_path):
|
def test_github_action_output_notset(self, monkeypatch, tmp_path):
|
||||||
|
# not set config
|
||||||
monkeypatch.setenv('GITHUB_OUTPUT', str(tmp_path / 'output'))
|
monkeypatch.setenv('GITHUB_OUTPUT', str(tmp_path / 'output'))
|
||||||
output_data = {'key1': {'value1': 1, 'value2': 2}}
|
output_data = {'key1': {'value1': 1, 'value2': 2}}
|
||||||
key_name = 'key1'
|
key_name = 'key1'
|
||||||
|
|
@ -38,3 +39,12 @@ class TestGitHubOutput:
|
||||||
github_action_output(output_data, key_name)
|
github_action_output(output_data, key_name)
|
||||||
|
|
||||||
assert not os.path.exists(str(tmp_path / 'output'))
|
assert not os.path.exists(str(tmp_path / 'output'))
|
||||||
|
|
||||||
|
def test_github_action_output_error_case(self, monkeypatch, tmp_path):
|
||||||
|
monkeypatch.setenv('GITHUB_OUTPUT', str(tmp_path / 'output'))
|
||||||
|
output_data = None # invalid data
|
||||||
|
key_name = 'key1'
|
||||||
|
|
||||||
|
github_action_output(output_data, key_name)
|
||||||
|
|
||||||
|
assert not os.path.exists(str(tmp_path / 'output'))
|
||||||
Loading…
Reference in a new issue