Skip to content

Commit

Permalink
Per Giuseppe's proposals
Browse files Browse the repository at this point in the history
  • Loading branch information
rohe committed Feb 19, 2024
1 parent aea2afd commit 966bf92
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/idpyoidc/storage/listfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ def _read_info(self, fname):
fp = open(fname, "r")
info = [x.strip() for x in fp.readlines()]
lock.release()
if info == "":
return None
else:
return info
return info or None
except Exception as err:
logger.error(err)
raise
Expand Down
2 changes: 1 addition & 1 deletion tests/pub_iss.jwks
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"keys": [{"kty": "EC", "use": "sig", "kid": "SmdKMlVGcG1zMnprdDdXZGpGWEczdHhlZVpGbkx1THpPdUY4d0w4bnZkSQ", "crv": "P-256", "x": "tRHJYm0fsOi0icpGEb33qiDVgt68ltMoYSWdLGhDGz4", "y": "fRpX0i6p5Jigf5I0qwW34PyStosMShwWAWS8x_w5o7E"}, {"kty": "RSA", "use": "sig", "kid": "R0FsaFdqREFaUFp1c0MwbUpsbHVSZ200blBJZWJVMTUtNGsyVlBmdHk5UQ", "e": "AQAB", "n": "2ilgsKVqF92KfhwmosSVeZOaDgb3RF1mbg-pqkmLO6YpOO06LF4V4angF-GhP-ysAm2E75aSIU4tnHVThFlcxTgKFqjYKJQXyVzTVK2r-L2IbvFPaDtvoU6WteybpMlIUVk2po3cFDGObCWYKCm7CUOLlwH0uOpui66P9VSCqdKVKbJRAQBvTSbP10KWPxulfqjWGJtHO5fY7-JVWwOBkG-eHSJIT_uaoPjyvKCZjknq04bLUV9qP78KRQpRyYijBN60w2v8F79baN9CN10TIEjjWKGz0uX0M_YYQzTUoSY5l5ka9RkL3wT4o2iQ1t5nHphX6aA-gqwgCQmi-nvjaw"}]}
{"keys": [{"kty": "EC", "use": "sig", "kid": "SmdKMlVGcG1zMnprdDdXZGpGWEczdHhlZVpGbkx1THpPdUY4d0w4bnZkSQ", "crv": "P-256", "x": "tRHJYm0fsOi0icpGEb33qiDVgt68ltMoYSWdLGhDGz4", "y": "fRpX0i6p5Jigf5I0qwW34PyStosMShwWAWS8x_w5o7E"}, {"kty": "RSA", "use": "sig", "kid": "R0FsaFdqREFaUFp1c0MwbUpsbHVSZ200blBJZWJVMTUtNGsyVlBmdHk5UQ", "n": "2ilgsKVqF92KfhwmosSVeZOaDgb3RF1mbg-pqkmLO6YpOO06LF4V4angF-GhP-ysAm2E75aSIU4tnHVThFlcxTgKFqjYKJQXyVzTVK2r-L2IbvFPaDtvoU6WteybpMlIUVk2po3cFDGObCWYKCm7CUOLlwH0uOpui66P9VSCqdKVKbJRAQBvTSbP10KWPxulfqjWGJtHO5fY7-JVWwOBkG-eHSJIT_uaoPjyvKCZjknq04bLUV9qP78KRQpRyYijBN60w2v8F79baN9CN10TIEjjWKGz0uX0M_YYQzTUoSY5l5ka9RkL3wT4o2iQ1t5nHphX6aA-gqwgCQmi-nvjaw", "e": "AQAB"}]}
4 changes: 1 addition & 3 deletions tests/test_14_read_only_list_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ def test_read_only_list_file():
assert len(_read_only) == 0

with open(FILE_NAME, "w") as fp:
for item in ["one", "two", "three"]:
fp.write(item)
fp.write("\n")
fp.writelines(line + '\n' for line in ["one", "two", "three"])

assert len(_read_only) == 3
assert set(_read_only) == {"one", "two", "three"}
Expand Down

0 comments on commit 966bf92

Please sign in to comment.