move from urrlib.request.urlopen to requests.get

Fixes: https://pagure.io/koji/issue/1530
This commit is contained in:
Tomas Kopecek 2019-07-08 15:04:46 +02:00
parent 8920d9d613
commit aad9fac8d9
5 changed files with 58 additions and 52 deletions

View file

@ -62,6 +62,7 @@ class TestFastUpload(unittest.TestCase):
def setUp(self):
self.ksession = koji.ClientSession('http://koji.example.com/kojihub')
self.ksession.logout = mock.MagicMock()
self.do_fake_login()
# mocks
self.ksession._callMethod = mock.MagicMock()
@ -89,7 +90,6 @@ class TestFastUpload(unittest.TestCase):
self.ksession.fastUpload('nonexistent_file', 'target')
def test_fastUpload_nofile(self):
# fail with nonexistent file (IOError)
self.file_mock.side_effect = IOError('mocked exception')
with self.assertRaises(IOError):
@ -180,6 +180,7 @@ class TestMultiCall(unittest.TestCase):
self.ksession = koji.ClientSession('http://koji.example.com/kojihub')
# mocks
self.ksession._sendCall = mock.MagicMock()
self.ksession.logout = mock.MagicMock()
def tearDown(self):
del self.ksession