Esempio n. 1
0
 def test_pwdGetByName(self):
     """
     L{_pwdGetByName} returns a tuple of items from the UNIX /etc/passwd
     database if the L{pwd} module is present.
     """
     userdb = UserDatabase()
     userdb.addUser(
         'alice', 'secrit', 1, 2, 'first last', '/foo', '/bin/sh')
     self.patch(checkers, 'pwd', userdb)
     self.assertEqual(
         checkers._pwdGetByName('alice'), userdb.getpwnam('alice'))
Esempio n. 2
0
 def test_pwdGetByName(self):
     """
     L{_pwdGetByName} returns a tuple of items from the UNIX /etc/passwd
     database if the L{pwd} module is present.
     """
     userdb = UserDatabase()
     userdb.addUser(
         'alice', 'secrit', 1, 2, 'first last', '/foo', '/bin/sh')
     self.patch(checkers, 'pwd', userdb)
     self.assertEqual(
         checkers._pwdGetByName('alice'), userdb.getpwnam('alice'))
Esempio n. 3
0
 def test_pwdGetByNameWithoutPwd(self):
     """
     If the C{pwd} module isn't present, L{_pwdGetByName} returns C{None}.
     """
     self.patch(checkers, 'pwd', None)
     self.assertIs(checkers._pwdGetByName('alice'), None)
Esempio n. 4
0
 def test_pwdGetByNameWithoutPwd(self):
     """
     If the C{pwd} module isn't present, L{_pwdGetByName} returns C{None}.
     """
     self.patch(checkers, 'pwd', None)
     self.assertIs(checkers._pwdGetByName('alice'), None)
Esempio n. 5
0
 def test_pwdGetByNameWithoutPwd(self):
     """
     If the C{pwd} module isn't present, L{_pwdGetByName} returns L{None}.
     """
     self.patch(checkers, "pwd", None)
     self.assertIsNone(checkers._pwdGetByName("alice"))