move from urrlib.request.urlopen to requests.get
Fixes: https://pagure.io/koji/issue/1530
This commit is contained in:
parent
8920d9d613
commit
aad9fac8d9
5 changed files with 58 additions and 52 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue