Skip to content

Commit

Permalink
fixup! Add a test VO and ResourceGroup; use them for a test for scito…
Browse files Browse the repository at this point in the history
…kens.conf Issuer block 50-character limit (SOFTWARE-5659)

putting parens in an `assert` statement does not do what you want
  • Loading branch information
matyasselmeci committed Oct 30, 2023
1 parent e90fb13 commit 23fe078
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/tests/test_stashcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ def test_scitokens_issuer_character_limit(self, client: flask.Flask):
cp.read_string(origin_scitokens_conf, "origin_scitokens.conf")

assert "Global" in cp, "Missing Global section"
assert ("Issuer https://test.wisc.edu" in cp,
"Issuer with reasonable length missing")
assert ("Issuer issuer-thats-50-characters-long-if-you.chop" in cp,
"Issuer that just barely fits if you chop off the scheme missing")
assert "Issuer https://test.wisc.edu" in cp, \
"Issuer with reasonable length missing"
assert "Issuer issuer-thats-50-characters-long-if-you.chop" in cp, \
"Issuer that just barely fits if you chop off the scheme missing"
assert (cp["Issuer issuer-thats-50-characters-long-if-you.chop"]["issuer"] ==
"https://issuer-thats-50-characters-long-if-you.chop",
"Unexpected issuer in a section we modified")
assert (not re.search(r"^\[[^]]{51}", origin_scitokens_conf, re.MULTILINE),
"Section over 50 chars long found")
"https://issuer-thats-50-characters-long-if-you.chop"), \
"Unexpected issuer in a section we modified"
assert not re.search(r"^\[[^]]{51}", origin_scitokens_conf, re.MULTILINE), \
"Section over 50 chars long found"
# ^^ easier to regexp this

def test_None_fdqn_isnt_error(self, client: flask.Flask):
Expand Down

0 comments on commit 23fe078

Please sign in to comment.