From 45176ab8932a07ba32cb226f340301a1003dc4fa Mon Sep 17 00:00:00 2001 From: idubnori Date: Wed, 10 Apr 2024 09:17:29 +0900 Subject: [PATCH] test: add config not set case --- tests/unittest/test_github_output.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/unittest/test_github_output.py b/tests/unittest/test_github_output.py index 2ac3d2c7..a046ec7d 100644 --- a/tests/unittest/test_github_output.py +++ b/tests/unittest/test_github_output.py @@ -28,4 +28,13 @@ class TestGitHubOutput: github_output(output_data, key_name) + assert not os.path.exists(str(tmp_path / 'output')) + + def test_github_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) + assert not os.path.exists(str(tmp_path / 'output')) \ No newline at end of file