Esempio n. 1
0
 def test_setuid_with_id(self):
     with mock.patch('os.setuid') as setuid_mock:
         daemon.setuid('321')
         setuid_mock.assert_called_once_with(321)
Esempio n. 2
0
 def test_setuid_with_name(self):
     with mock.patch('pwd.getpwnam', return_value=FakeEntry('pw_uid', 123)):
         with mock.patch('os.setuid') as setuid_mock:
             daemon.setuid('user')
             setuid_mock.assert_called_once_with(123)
Esempio n. 3
0
 def test_setuid_with_id(self):
     with mock.patch('os.setuid') as setuid_mock:
         daemon.setuid('321')
         setuid_mock.assert_called_once_with(321)
Esempio n. 4
0
 def test_setuid_with_name(self):
     with mock.patch('pwd.getpwnam', return_value=FakeEntry('pw_uid', 123)):
         with mock.patch('os.setuid') as setuid_mock:
             daemon.setuid('user')
             setuid_mock.assert_called_once_with(123)
Esempio n. 5
0
 def test_setuid_with_id(self):
     with mock.patch("os.setuid") as setuid_mock:
         daemon.setuid("321")
         setuid_mock.assert_called_once_with(321)
Esempio n. 6
0
 def test_setuid_with_name(self):
     with mock.patch("pwd.getpwnam", return_value=FakeEntry("pw_uid", 123)):
         with mock.patch("os.setuid") as setuid_mock:
             daemon.setuid("user")
             setuid_mock.assert_called_once_with(123)