def test_delete(self): ''' Tests if the specified group was deleted ''' mock_ret = MagicMock(return_value=0) with patch.dict(mac_group.__salt__, {'cmd.retcode': mock_ret}): self.assertTrue(mac_group.delete('test'))
def test_delete(): """ Tests if the specified group was deleted """ mock_ret = MagicMock(return_value=0) mock_group = {"passwd": "*", "gid": 0, "name": "test", "members": ["root"]} with patch.dict(mac_group.__salt__, {"cmd.retcode": mock_ret}), patch( "salt.modules.mac_group.info", MagicMock(return_value=mock_group)): assert mac_group.delete("test")
def test_delete(self): ''' Tests if the specified group was deleted ''' mock_ret = MagicMock(return_value=0) mock_group = { 'passwd': '*', 'gid': 0, 'name': 'test', 'members': ['root'] } with patch.dict(mac_group.__salt__, {'cmd.retcode': mock_ret}), \ patch('salt.modules.mac_group.info', MagicMock(return_value=mock_group)): self.assertTrue(mac_group.delete('test'))
def test_delete_group_exists(self): ''' Tests if the group to be deleted exists or not ''' with patch('salt.modules.mac_group.info', MagicMock(return_value={})): self.assertTrue(mac_group.delete('test'))
def test_delete_group_exists(): """ Tests if the group to be deleted exists or not """ with patch("salt.modules.mac_group.info", MagicMock(return_value={})): assert mac_group.delete("test")
def test_delete_group_exists(self): ''' Tests if the group to be deleted exists or not ''' self.assertTrue(mac_group.delete('test'))