'Make sure one cannot operate on federated domain.
This includes operations like create, update, delete
on domain identified by id and name where difference variations of
id \'Federated\' are used.'

def test_forbid_operations_on_federated_domain(self):

    def create_domains():
        for variation in ('Federated', 'FEDERATED', 'federated', 'fEderated'):
            domain = unit.new_domain_ref()
            domain['id'] = variation
            (yield domain)
    for domain in create_domains():
        self.assertRaises(AssertionError, self.resource_api.create_domain, domain['id'], domain)
        self.assertRaises(AssertionError, self.resource_api.update_domain, domain['id'], domain)
        self.assertRaises(exception.DomainNotFound, self.resource_api.delete_domain, domain['id'])
        (domain['id'], domain['name']) = (domain['name'], domain['id'])
        self.assertRaises(AssertionError, self.resource_api.create_domain, domain['id'], domain)
        self.assertRaises(AssertionError, self.resource_api.update_domain, domain['id'], domain)
        self.assertRaises(exception.DomainNotFound, self.resource_api.delete_domain, domain['id'])
