Ejemplo n.º 1
0
 def test_setgid_with_id(self):
     with mock.patch('os.setgid') as setgid_mock:
         daemon.setgid('321')
         setgid_mock.assert_called_once_with(321)
Ejemplo n.º 2
0
 def test_setgid_with_name(self):
     with mock.patch('grp.getgrnam', return_value=FakeEntry('gr_gid', 123)):
         with mock.patch('os.setgid') as setgid_mock:
             daemon.setgid('group')
             setgid_mock.assert_called_once_with(123)
Ejemplo n.º 3
0
 def test_setgid_with_id(self):
     with mock.patch('os.setgid') as setgid_mock:
         daemon.setgid('321')
         setgid_mock.assert_called_once_with(321)
Ejemplo n.º 4
0
 def test_setgid_with_name(self):
     with mock.patch('grp.getgrnam', return_value=FakeEntry('gr_gid', 123)):
         with mock.patch('os.setgid') as setgid_mock:
             daemon.setgid('group')
             setgid_mock.assert_called_once_with(123)
Ejemplo n.º 5
0
 def test_setgid_with_id(self):
     with mock.patch("os.setgid") as setgid_mock:
         daemon.setgid("321")
         setgid_mock.assert_called_once_with(321)
Ejemplo n.º 6
0
 def test_setgid_with_name(self):
     with mock.patch("grp.getgrnam", return_value=FakeEntry("gr_gid", 123)):
         with mock.patch("os.setgid") as setgid_mock:
             daemon.setgid("group")
             setgid_mock.assert_called_once_with(123)