remove duplicate function definition
This commit is contained in:
parent
2a286579cb
commit
26fd8f6f68
|
@ -235,20 +235,6 @@ def mocks_for_create_user():
|
|||
yield
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def mocks_for_create_user():
|
||||
with patch.object(utils, 'gen_password') as gen_password_mock, \
|
||||
patch.object(pwd, 'getpwuid') as getpwuid_mock, \
|
||||
patch.object(grp, 'getgrgid') as getgrgid_mock:
|
||||
gen_password_mock.return_value = 'krb5'
|
||||
# Normally, if getpwuid or getgrgid do *not* raise a KeyError,
|
||||
# then LDAPService will skip that UID. Therefore, by raising a
|
||||
# KeyError, we are making sure that the UID will *not* be skipped.
|
||||
getpwuid_mock.side_effect = KeyError()
|
||||
getgrgid_mock.side_effect = KeyError()
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def simple_user():
|
||||
return User(
|
||||
|
|
Loading…
Reference in New Issue