mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-02 11:50:37 +08:00
clean: rename to github_action_output
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
import os
|
||||
import json
|
||||
from pr_agent.algo.utils import get_settings, github_output
|
||||
from pr_agent.algo.utils import get_settings, github_action_output
|
||||
|
||||
class TestGitHubOutput:
|
||||
def test_github_output_enabled(self, monkeypatch, tmp_path):
|
||||
def test_github_action_output_enabled(self, monkeypatch, tmp_path):
|
||||
get_settings().set('GITHUB_ACTION_CONFIG.ENABLE_OUTPUT', True)
|
||||
monkeypatch.setenv('GITHUB_OUTPUT', str(tmp_path / 'output'))
|
||||
output_data = {'key1': {'value1': 1, 'value2': 2}}
|
||||
key_name = 'key1'
|
||||
|
||||
github_output(output_data, key_name)
|
||||
github_action_output(output_data, key_name)
|
||||
|
||||
with open(str(tmp_path / 'output'), 'r') as f:
|
||||
env_value = f.read()
|
||||
@ -20,21 +20,21 @@ class TestGitHubOutput:
|
||||
assert actual_key == key_name
|
||||
assert actual_data == output_data[key_name]
|
||||
|
||||
def test_github_output_disabled(self, monkeypatch, tmp_path):
|
||||
def test_github_action_output_disabled(self, monkeypatch, tmp_path):
|
||||
get_settings().set('GITHUB_ACTION_CONFIG.ENABLE_OUTPUT', False)
|
||||
monkeypatch.setenv('GITHUB_OUTPUT', str(tmp_path / 'output'))
|
||||
output_data = {'key1': {'value1': 1, 'value2': 2}}
|
||||
key_name = 'key1'
|
||||
|
||||
github_output(output_data, key_name)
|
||||
github_action_output(output_data, key_name)
|
||||
|
||||
assert not os.path.exists(str(tmp_path / 'output'))
|
||||
|
||||
def test_github_output_notset(self, monkeypatch, tmp_path):
|
||||
def test_github_action_output_notset(self, monkeypatch, tmp_path):
|
||||
monkeypatch.setenv('GITHUB_OUTPUT', str(tmp_path / 'output'))
|
||||
output_data = {'key1': {'value1': 1, 'value2': 2}}
|
||||
key_name = 'key1'
|
||||
|
||||
github_output(output_data, key_name)
|
||||
github_action_output(output_data, key_name)
|
||||
|
||||
assert not os.path.exists(str(tmp_path / 'output'))
|
Reference in New Issue
Block a user