Пример #1
0
def test_info():
    """
    Tests the return of group information
    """
    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.info("foo") == ret
Пример #2
0
 def test_info(self):
     '''
     Tests the return of group information
     '''
     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.info('foo'), ret)
Пример #3
0
 def test_info(self):
     '''
     Tests the return of group information
     '''
     ret = {'passwd': '*', 'gid': 20, 'name': 'foo', 'members': ['test']}
     self.assertEqual(mac_group.info('foo'), ret)
Пример #4
0
 def test_info(self):
     '''
     Tests the return of group information
     '''
     ret = {'passwd': '*', 'gid': 20, 'name': 'foo', 'members': ['test']}
     self.assertEqual(mac_group.info('foo'), ret)