Test krbv failing when krbV is not installed.
This commit is contained in:
parent
f475b92802
commit
01bb6e63fa
2 changed files with 25 additions and 0 deletions
18
tests/test_krbv.py
Normal file
18
tests/test_krbv.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import unittest
|
||||
|
||||
# This is python-mock, not the rpm mock tool we know and love
|
||||
import mock
|
||||
|
||||
import koji
|
||||
|
||||
|
||||
class KrbVTestCase(unittest.TestCase):
|
||||
|
||||
@mock.patch('koji.krbV', new=None)
|
||||
@mock.patch('koji.ClientSession._setup_connection')
|
||||
def test_krbv_disabled(self, krbV):
|
||||
""" Test that when krbV is absent, we behave rationally. """
|
||||
self.assertEquals(koji.krbV, None)
|
||||
session = koji.ClientSession('whatever')
|
||||
with self.assertRaises(ImportError):
|
||||
session.krb_login()
|
||||
Loading…
Add table
Add a link
Reference in a new issue