PR#4357: Fix two unit test issues
Merges #4357 https://pagure.io/koji/pull-request/4357
This commit is contained in:
commit
caeac8e7c7
2 changed files with 5 additions and 0 deletions
|
|
@ -14,6 +14,9 @@ class TestHubConfig(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.context = mock.patch('kojihub.kojihub.context').start()
|
self.context = mock.patch('kojihub.kojihub.context').start()
|
||||||
|
# load_config modfies pathinfo, make sure it is restored
|
||||||
|
mock.patch('koji.pathinfo').start()
|
||||||
|
mock.patch('koji.BASEDIR').start()
|
||||||
self.tempdir = tempfile.mkdtemp()
|
self.tempdir = tempfile.mkdtemp()
|
||||||
self.environ = {
|
self.environ = {
|
||||||
'koji.hub.ConfigFile': self.tempdir + '/hub.conf',
|
'koji.hub.ConfigFile': self.tempdir + '/hub.conf',
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ class TestGSSAPI(unittest.TestCase):
|
||||||
self.session = koji.ClientSession('https://koji.example.com/kojihub',
|
self.session = koji.ClientSession('https://koji.example.com/kojihub',
|
||||||
{})
|
{})
|
||||||
self.session._callMethod = mock.MagicMock(name='_callMethod')
|
self.session._callMethod = mock.MagicMock(name='_callMethod')
|
||||||
|
self.session.logout = mock.MagicMock(name='logout')
|
||||||
|
# logout bypasses _callMethod. mock needed for __del__ to work
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
mock.patch.stopall()
|
mock.patch.stopall()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue