Skip to content

Commit

Permalink
tests: improve test_publish_tags_whls
Browse files Browse the repository at this point in the history
  • Loading branch information
suvayu committed Oct 4, 2024
1 parent af6f872 commit 3c9a164
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion orchestra/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ def publish_tags_whls(CONF: dict, pkgtags: Path):
continue
repo = Repo(repo_path)
push_tags(CONF, pkg, repo, tags[remote_name(repo)])
dispatch_workflow(CONF, pkgtags)
return dispatch_workflow(CONF, pkgtags)
9 changes: 7 additions & 2 deletions tests/test_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,16 @@ def test_dispatch_workflow(CONF, cmd, monkeypatch):
@pytest.mark.parametrize("dup_repos", ["scm"], indirect=True)
@pytest.mark.parametrize("cmd", ["echo {repo} {workflow}"])
def test_publish_tags_whls(CONF, dup_repos, cmd, monkeypatch):
name, _, src, dst = dup_repos
monkeypatch.setattr("sys.stdin", StringIO("0"))
monkeypatch.setattr("orchestra.publish.CMD_FMT", cmd)

name, origin, src, dst = dup_repos
dst.create_tag("test_tag")
pkgtags = Path(f"{dst.working_dir}/pkgtags.json")
pkgtags.write_text(json.dumps({"scm": "test_tag"}))

# FIXME: is this sufficient?
publish_tags_whls(CONF, pkgtags)
res = publish_tags_whls(CONF, pkgtags)
assert not isinstance(res, Exception)
out = res.stdout.decode("utf8")
assert all(token in out for token in CONF["workflow"].values())

0 comments on commit 3c9a164

Please sign in to comment.