Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
albu-diku committed Aug 14, 2024
1 parent b73a5a9 commit 7a2fce1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 0 additions & 1 deletion local-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# migrid dependencies on a format suitable for pip install as described on
# https://pip.pypa.io/en/stable/reference/requirement-specifiers/
autopep8
urllib3
4 changes: 2 additions & 2 deletions mig/server/grid_openid.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,10 @@ class ThreadedOpenIDHTTPServer(ThreadingMixIn, OpenIDHTTPServer):

def __init__(self, configuration, **kwargs):
self._started = threading.Event()
super(ThreadedOpenIDHTTPServer, self).__init__(configuration, **kwargs)
OpenIDHTTPServer.__init__(self, configuration, **kwargs)

def server_activate(self):
super(ThreadedOpenIDHTTPServer, self).server_activate()
OpenIDHTTPServer.server_activate(self)
self._started.set()

def wait_start(self):
Expand Down
14 changes: 10 additions & 4 deletions tests/test_mig_server_grid_openid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os
import sys
from threading import Thread
import urllib3

from tests.support import PY2, MIG_BASE, testmain, MigTestCase

Expand All @@ -15,6 +14,12 @@
_TEST_CONF_FILE = os.path.join(_TEST_CONF_DIR, "MiGserver.conf")


if PY2:
from urllib2 import urlopen
else:
from urllib.request import urlopen


class TestThreadedOpenIDServerExecutor(Thread):
def __init__(self, configuration):
super(TestThreadedOpenIDServerExecutor, self).__init__()
Expand Down Expand Up @@ -66,10 +71,11 @@ def test_xxx(self):
self.server_thread.start()
self.server_thread.wait_until_ready()

response = urllib3.request(
'GET', self._test_url('/'), retries=0, timeout=2000)
response = urlopen(self._test_url('/'), None, timeout=2000)
response.read()

self.assertEqual(response.status, 200)
status = response.getcode()
self.assertEqual(status, 200)

@staticmethod
def _make_server(configuration):
Expand Down

0 comments on commit 7a2fce1

Please sign in to comment.