def test_positive_add_and_remove_domains(module_org): """Add and remove domains to organization :id: 97359ffe-4ce6-4e44-9e3f-583d3fdebbc8 :expectedresults: Domains are handled correctly :BZ: 1395229 :steps: 1. Add and remove domain by name 2. Add and remove domain by id :CaseLevel: Integration """ domains = [make_domain() for _ in range(0, 2)] Org.add_domain({'domain-id': domains[0]['id'], 'name': module_org.name}) Org.add_domain({'domain': domains[1]['name'], 'name': module_org.name}) org_info = Org.info({'id': module_org.id}) assert len(org_info['domains']) == 2, "Failed to add domains" assert domains[0]['name'] in org_info['domains'] assert domains[1]['name'] in org_info['domains'] Org.remove_domain({'domain': domains[0]['name'], 'name': module_org.name}) Org.remove_domain({'domain-id': domains[1]['id'], 'id': module_org.id}) org_info = Org.info({'id': module_org.id}) assert len(org_info['domains']) == 0, "Failed to remove domains"
def test_positive_add_and_remove_domains(self): """Add and remove domains to organization :id: 97359ffe-4ce6-4e44-9e3f-583d3fdebbc8 :expectedresults: Domains are handled correctly :BZ: 1395229 :steps: 1. Add and remove domain by name 2. Add and remove domain by id :CaseLevel: Integration """ domain_a = make_domain() domain_b = make_domain() Org.add_domain({'domain-id': domain_a['id'], 'name': self.org['name']}) Org.add_domain({'domain': domain_b['name'], 'name': self.org['name']}) org_info = Org.info({'id': self.org['id']}) self.assertEqual(len(org_info['domains']), 2, "Failed to add domains") self.assertIn(domain_a['name'], org_info['domains']) self.assertIn(domain_b['name'], org_info['domains']) Org.remove_domain({ 'domain': domain_a['name'], 'name': self.org['name'] }) Org.remove_domain({'domain-id': domain_b['id'], 'id': self.org['id']}) org_info = Org.info({'id': self.org['id']}) self.assertEqual(len(org_info['domains']), 0, "Failed to remove domains")
def test_positive_add_and_remove_domains(self): """Add and remove domains to organization :id: 97359ffe-4ce6-4e44-9e3f-583d3fdebbc8 :expectedresults: Domains are handled correctly :bz: 1395229 :steps: 1. Add and remove domain by name 2. Add and remove domain by id :CaseLevel: Integration """ org = make_org() domain_a = make_domain() domain_b = make_domain() Org.add_domain({ 'domain-id': domain_a['id'], 'name': org['name'], }) Org.add_domain({ 'domain': domain_b['name'], 'name': org['name'], }) org_info = Org.info({'id': org['id']}) self.assertEqual(len(org_info['domains']), 2, "Failed to add domains") self.assertIn(domain_a['name'], org_info['domains']) self.assertIn(domain_b['name'], org_info['domains']) Org.remove_domain({ 'domain': domain_a['name'], 'name': org['name'], }) Org.remove_domain({ 'domain-id': domain_b['id'], 'id': org['id'], }) org_info = Org.info({'id': org['id']}) self.assertEqual(len(org_info['domains']), 0, "Failed to remove domains")
def test_positive_remove_domain_by_id(self): """Remove a domain from organization by its ID @feature: Organization @assert: Domain is removed from the organization """ org = make_org() domain = make_domain() Org.add_domain({ 'domain-id': domain['id'], 'name': org['name'], }) result = Org.info({'id': org['id']}) self.assertEqual(len(result['domains']), 1) self.assertIn(domain['name'], result['domains']) Org.remove_domain({ 'domain-id': domain['id'], 'id': org['id'], }) result = Org.info({'id': org['id']}) self.assertEqual(len(result['domains']), 0)
def test_positive_remove_domain_by_name(self): """@Test: Add a domain and then remove it by its name @Feature: Organization @Assert: Domain is removed from the org """ org = make_org() domain = make_domain() Org.add_domain({ 'domain': domain['name'], 'name': org['name'], }) result = Org.info({'id': org['id']}) self.assertEqual(len(result['domains']), 1) self.assertIn(domain['name'], result['domains']) Org.remove_domain({ 'domain': domain['name'], 'name': org['name'], }) result = Org.info({'id': org['id']}) self.assertEqual(len(result['domains']), 0)
def test_positive_remove_domain_by_id(self): """Remove a domain from organization by its ID @id: 01ef8a26-e944-4cda-b60a-2b9d86a8051f @assert: Domain is removed from the organization @CaseLevel: Integration """ org = make_org() domain = make_domain() Org.add_domain({ 'domain-id': domain['id'], 'name': org['name'], }) result = Org.info({'id': org['id']}) self.assertEqual(len(result['domains']), 1) self.assertIn(domain['name'], result['domains']) Org.remove_domain({ 'domain-id': domain['id'], 'id': org['id'], }) result = Org.info({'id': org['id']}) self.assertEqual(len(result['domains']), 0)
def test_positive_remove_domain_by_name(self): """Remove a domain from organization by its name @id: 59ab55ab-782b-4ee2-b347-f1a1e37c55aa @Assert: Domain is removed from the org @CaseLevel: Integration """ org = make_org() domain = make_domain() Org.add_domain({ 'domain': domain['name'], 'name': org['name'], }) result = Org.info({'id': org['id']}) self.assertEqual(len(result['domains']), 1) self.assertIn(domain['name'], result['domains']) Org.remove_domain({ 'domain': domain['name'], 'name': org['name'], }) result = Org.info({'id': org['id']}) self.assertEqual(len(result['domains']), 0)