summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJames E. Blair <jim@acmegating.com>2023-05-15 14:18:23 -0700
committerJames E. Blair <jim@acmegating.com>2023-05-16 10:30:11 -0700
commit38423ed88373b909b864fc0bdf5d7268137b242e (patch)
treef53bd79b88e7053803ebb55830eb407b16e3a12f /tests
parenta9146705148afba092e31a7013676f9c5661a2c6 (diff)
downloadzuul-38423ed88373b909b864fc0bdf5d7268137b242e.tar.gz
Fix JWT auth test and alembic migration8.3.0
A new version of pyjwt was released which alters an internal call it makes to urllib which we have mocked in the unit tests. Our mock must be updated to match. The previous version would call urlopen with a string url argument, newer versions call it with a Request object (urllib accepts both). This change updates the mock to accept both. There has also been a recent alembic release which alters the function signature of alter_column so that most arguments are now required to be keyword arguments. This causes one of our migrations to fail since it was not passing the new type in as a positional argument. Notably, the type was not the next positional argument in the signature ("nullable" is), so this explains why we had two "change patchset to string" migrations: the first one did not actually work. This change alters the migration to do what it effectively did rather that what it was intended to do. The later migration continues to correct the error. Change-Id: I10cdffa43147f7f72e431e7c64e10e9416dfb295
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_auth.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/unit/test_auth.py b/tests/unit/test_auth.py
index 95ccdb4a2..6d35d761e 100644
--- a/tests/unit/test_auth.py
+++ b/tests/unit/test_auth.py
@@ -70,6 +70,9 @@ def mock_get(url, params=None, **kwargs):
def mock_urlopen(url, *args, **kwargs):
+ if hasattr(url, 'full_url'):
+ # Like a urllib.Request object
+ url = url.full_url
if url == ("https://my.oidc.provider/auth/realms/realm-one/"
"protocol/openid-connect/certs"):
io = StringIO()