Exemplo n.º 1
0
    def test_info(self):
        '''
        Tests to return information about a group
        '''
        self.assertDictEqual(pw_group.info('name'), {})

        mock = MagicMock(return_value={'gr_name': 'A',
                                       'gr_passwd': 'B',
                                       'gr_gid': 1,
                                       'gr_mem': ['C', 'D']})
        with patch.dict(pw_group.grinfo, mock):
            self.assertDictEqual(pw_group.info('name'), {})
Exemplo n.º 2
0
    def test_info(self):
        '''
        Tests to return information about a group
        '''
        self.assertDictEqual(pw_group.info('name'), {})

        mock = MagicMock(return_value={'gr_name': 'A',
                                       'gr_passwd': 'B',
                                       'gr_gid': 1,
                                       'gr_mem': ['C', 'D']})
        with patch.dict(pw_group.grinfo, mock):
            self.assertDictEqual(pw_group.info('name'), {})
Exemplo n.º 3
0
def test_info():
    """
    Tests to return information about a group
    """
    assert pw_group.info("name") == {}

    mock = MagicMock(return_value={
        "gr_name": "A",
        "gr_passwd": "B",
        "gr_gid": 1,
        "gr_mem": ["C", "D"],
    })
    with patch.dict(pw_group.grinfo, mock):
        assert pw_group.info("name") == {}
Exemplo n.º 4
0
    def test_info(self):
        """
        Tests to return information about a group
        """
        self.assertDictEqual(pw_group.info("name"), {})

        mock = MagicMock(return_value={
            "gr_name": "A",
            "gr_passwd": "B",
            "gr_gid": 1,
            "gr_mem": ["C", "D"],
        })
        with patch.dict(pw_group.grinfo, mock):
            self.assertDictEqual(pw_group.info("name"), {})