def test_access_control_with_invalid_permission(self):
    invalid_permissions = ['can_varimport', 'can_eat_pudding']
    username = 'LaUser'
    user = fab_utils.create_user(self.app, username=username, role_name='team-a')
    for permission in invalid_permissions:
        self.expect_user_is_in_role(user, rolename='team-a')
        with self.assertRaises(AirflowException) as context:
            self.security_manager.sync_perm_for_dag('access_control_test', access_control={'team-a': {permission}})
        self.assertIn('invalid permissions', str(context.exception))
def test_access_control_with_invalid_permission(self):
    invalid_permissions = ['can_varimport', 'can_eat_pudding']
    username = 'LaUser'
    user = fab_utils.create_user(self.app, username=username, role_name='team-a')
    for permission in invalid_permissions:
        self.expect_user_is_in_role(user, rolename='team-a')
        with self.assertRaises(AirflowException) as context:
            self.security_manager.sync_perm_for_dag('access_control_test', access_control={'team-a': {permission}})
        self.assertIn('invalid permissions', str(context.exception))