test 79: a hand-typed title is not a signup; the field wins over the title; unlabel and the clone URL pinned
ci / test (pull_request) Successful in 36s

This commit is contained in:
teahubxyz committed 2026-10-18 17:13:45 +00:00
1 parent 8d1f03fa19
commit 22259a579a
1 file changed
+10 -2
+10 -2
View File
@@ -971,7 +971,9 @@ card79 = gv.new_card("Venture 2026-10-18")
assert card79["labels"] == [100] and f79.calls[-1][1] == "/repos/o/r/issues", "Gitea creates with label ids"
# signups: the form's label or its prefilled title; never the owner, a bot, Time's users or a seat; reactions may be null
f79 = G79([iss79(10, "Early access: Star checker", ["signup"], body="### Venture\n\nstar-checker\n\n### Plan\n\nFree\n\n### What would you use it for?\n\nmy repos"),
iss79(11, "Early access: Star checker", [], user={"login": "bob"}), # could not label: the title says it
iss79(11, "Early access: Star checker", [], user={"login": "bob"}, # could not label, left the field empty:
body="### Venture\n\n_No response_\n\n### Plan\n\nFree\n\n### What would you use it for?\n\n_No response_"), # the title says it
iss79(15, "Early access: Star checker", [], user={"login": "zed"}, body="hand-typed, no form"), # not the form: no
iss79(12, "Early access: Star checker", ["signup"], user={"login": "o"}), # the owner
iss79(13, "Early access: Star checker", ["signup"], user={"login": "sonnet"}), # a seat
iss79(14, "Early access: Other", ["signup"], user={"login": "cy"}, body="### Venture\n\nother\n")])
@@ -981,7 +983,13 @@ f79.reactions = [{"content": "+1", "user": {"login": "dee"}}, {"content": "heart
{"content": "+1", "user": {"login": "gitea-actions"}}]
gv.signup_issues.cache_clear()
assert gv.count_signups(w79)[0] == 3, "a 👍 on the signal issue counts; a heart or Time's own does not"
assert gv.signup_for(f79.rows[1], w79) and not gv.signup_for(f79.rows[4], w79)
assert gv.signup_for(f79.rows[1], w79) and not gv.signup_for(f79.rows[4], w79) and not gv.signup_for(f79.rows[5], w79)
# the field wins over the title: a form answered for another venture never counts here, whatever its title
assert not gv.signup_for({"title": "Early access: Star checker", "body": "### Venture\n\nother\n\n### Plan\n\nFree\n\n### What would you use it for?\n\nx"}, w79)
# the helpers the port leans on: removing a label goes by id; the browser pass clones with the token like every worker
gv.tm.unlabel(5, "needs-human")
assert f79.calls[-1][:2] == ("DELETE", "/repos/o/r/issues/5/labels/103"), f79.calls[-1]
assert gv.tm._git_url(True) == "https://x-access-token:gh@forge.test/o/r.git" and gv.tm._git_url(False) == "https://forge.test/o/r.git"
# a retry counts from someone trusted only: Gitea has no author_association, and Time never vouches for itself
os.environ["TIME_TRUSTED"] = "princess"
gv.tm._trust.clear()