Skip to content

Commit

Permalink
(small unrelated fixes)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewjoachim committed Dec 22, 2023
1 parent 31472e6 commit d07e077
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion coverage_comment/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def GITHUB_PR_NUMBER(self) -> int | None:

@property
def GITHUB_BRANCH_NAME(self) -> str | None:
# "refs/head/my_branch_name"
# "refs/heads/my_branch_name"
if "heads" in self.GITHUB_REF:
return self.GITHUB_REF.split("/", 2)[2]
return None
Expand Down
16 changes: 10 additions & 6 deletions tests/integration/test_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def test_download_artifact(gh, session, zip_bytes):
github=gh,
repository="foo/bar",
artifact_name="foo",
run_id="123",
filename="foo.txt",
run_id=123,
filename=pathlib.Path("foo.txt"),
)

assert result == "bar"
Expand All @@ -83,8 +83,8 @@ def test_download_artifact__no_artifact(gh, session):
github=gh,
repository="foo/bar",
artifact_name="foo",
run_id="123",
filename="foo.txt",
run_id=123,
filename=pathlib.Path("foo.txt"),
)


Expand All @@ -104,8 +104,8 @@ def test_download_artifact__no_file(gh, session, zip_bytes):
github=gh,
repository="foo/bar",
artifact_name="foo",
run_id="123",
filename="bar.txt",
run_id=123,
filename=pathlib.Path("bar.txt"),
)


Expand Down Expand Up @@ -303,6 +303,10 @@ def test_set_output(output_file):
assert output_file.read_text() == "foo=true\n"


def test_set_output__empty():
assert github.set_output(github_output=None, foo=True) is None


def test_get_workflow_command():
output = github.get_workflow_command(
command="foo", command_value="bar", file="main.py", line="1", title="someTitle"
Expand Down

0 comments on commit d07e077

Please sign in to comment.