Skip to content

Commit

Permalink
Fix old test cases to comply with GH issue number range
Browse files Browse the repository at this point in the history
  • Loading branch information
menkotoglou committed Dec 18, 2023
1 parent f864c05 commit 724fefb
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 13 deletions.
8 changes: 3 additions & 5 deletions blurb/blurb.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,9 @@ def finish_entry():
# we'll complain about the *first* error
# we see in the blurb file, which is a
# better user experience.
if key == "gh-issue" and int(value) < 32426:
throw("The gh-issue number should be 32426 or above.")

if key in issue_keys:
try:
int(value)
Expand Down Expand Up @@ -959,11 +962,6 @@ def init_tmp_with_template():
assert len(blurb) # if parse_blurb succeeds, we should always have a body
if len(blurb) > 1:
failure = "Too many entries! Don't specify '..' on a line by itself."
gh_issue_number = blurb[0][0]["gh-issue"]
if not gh_issue_number.isdigit():
failure = "The gh-issue number must be a number."
if int(gh_issue_number) < 32426:
failure = "The gh-issue number should be 32426 or above."

if failure:
print()
Expand Down
4 changes: 4 additions & 0 deletions blurb/tests/fail/small-gh-number.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. gh-issue: 100
.. section: Library
This is an invalid blurb. GitHub issues should be 32426 or above.
2 changes: 1 addition & 1 deletion blurb/tests/pass/basic.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. date: 2017-05-02
.. gh-issue: 0
.. gh-issue: 40000
.. nonce: xyz
.. section: Library
Expand Down
2 changes: 1 addition & 1 deletion blurb/tests/pass/basic.rst.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. date: 2017-05-02
.. gh-issue: 0
.. gh-issue: 40000
.. nonce: xyz
.. section: Library

Expand Down
2 changes: 1 addition & 1 deletion blurb/tests/pass/case-insensitive.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. date: 2017-05-02
.. GH-Issue: 0
.. GH-Issue: 35000
.. nonce: xyz
.. section: Library
Expand Down
2 changes: 1 addition & 1 deletion blurb/tests/pass/case-insensitive.rst.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. date: 2017-05-02
.. gh-issue: 0
.. gh-issue: 35000
.. nonce: xyz
.. section: Library

Expand Down
2 changes: 1 addition & 1 deletion blurb/tests/pass/no-break-long-words.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. date: 1234
.. gh-issue: 0
.. gh-issue: 35000
.. nonce: xyz
.. section: Library
Expand Down
2 changes: 1 addition & 1 deletion blurb/tests/pass/no-break-long-words.rst.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. date: 1234
.. gh-issue: 0
.. gh-issue: 35000
.. nonce: xyz
.. section: Library

Expand Down
2 changes: 1 addition & 1 deletion blurb/tests/pass/no-break-on-hyphens.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. date: 7333
.. gh-issue: 21121
.. gh-issue: 41121
.. nonce: ZLsRil
.. section: Library
Expand Down
2 changes: 1 addition & 1 deletion blurb/tests/pass/no-break-on-hyphens.rst.res
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. date: 7333
.. gh-issue: 21121
.. gh-issue: 41121
.. nonce: ZLsRil
.. section: Library

Expand Down

0 comments on commit 724fefb

Please sign in to comment.