Ejemplo n.º 1
0
def test_getent():
    """
    Tests the return of information on all groups
    """
    mock_getgrall = [grp.struct_group(("foo", "*", 20, ["test"]))]
    with patch("grp.getgrall", MagicMock(return_value=mock_getgrall)):
        ret = [{"passwd": "*", "gid": 20, "name": "foo", "members": ["test"]}]
        assert mac_group.getent() == ret
Ejemplo n.º 2
0
 def test_getent(self):
     '''
     Tests the return of information on all groups
     '''
     mock_getgrall = [grp.struct_group(('foo', '*', 20, ['test']))]
     with patch('grp.getgrall', MagicMock(return_value=mock_getgrall)):
         ret = [{
             'passwd': '*',
             'gid': 20,
             'name': 'foo',
             'members': ['test']
         }]
         self.assertEqual(mac_group.getent(), ret)
Ejemplo n.º 3
0
 def test_getent(self):
     '''
     Tests the return of information on all groups
     '''
     ret = [{'passwd': '*', 'gid': 20, 'name': 'foo', 'members': ['test']}]
     self.assertEqual(mac_group.getent(), ret)
Ejemplo n.º 4
0
 def test_getent(self):
     '''
     Tests the return of information on all groups
     '''
     ret = [{'passwd': '*', 'gid': 20, 'name': 'foo', 'members': ['test']}]
     self.assertEqual(mac_group.getent(), ret)