def test_positive_add_and_remove_subnets(self): """add and remove a subnet from organization :id: adb5310b-76c5-4aca-8220-fdf0fe605cb0 :BZ: 1. Add and remove subnet by name 2. Add and remove subnet by id :expectedresults: Subnets are handled as expected :BZ: 1395229 :CaseLevel: Integration """ subnet_a = make_subnet() subnet_b = make_subnet() Org.add_subnet({'name': self.org['name'], 'subnet': subnet_a['name']}) Org.add_subnet({'name': self.org['name'], 'subnet-id': subnet_b['id']}) org_info = Org.info({'id': self.org['id']}) self.assertEqual(len(org_info['subnets']), 2, "Failed to add subnets") Org.remove_subnet({ 'name': self.org['name'], 'subnet': subnet_a['name'] }) Org.remove_subnet({ 'name': self.org['name'], 'subnet-id': subnet_b['id'] }) org_info = Org.info({'id': self.org['id']}) self.assertEqual(len(org_info['subnets']), 0, "Failed to remove subnets")
def test_positive_add_subnet_by_id(self): """Add a subnet to organization by its ID @feature: Organization @assert: Subnet is added to the org """ org = make_org() new_subnet = make_subnet() Org.add_subnet({ 'name': org['name'], 'subnet-id': new_subnet['id'], }) org = Org.info({'id': org['id']}) self.assertIn(new_subnet['name'], org['subnets'][0])
def test_positive_add_subnet_by_name(self): """Add a subnet to organization by its name @Feature: Organization @Assert: Subnet is added to the org """ for name in valid_data_list(): with self.subTest(name): org = make_org() new_subnet = make_subnet({'name': name}) Org.add_subnet({ 'name': org['name'], 'subnet': new_subnet['name'], }) org = Org.info({'id': org['id']}) self.assertIn(name, org['subnets'][0])
def test_positive_add_subnet_by_id(self): """Add a subnet to organization by its ID @id: f65e4264-4aad-42f8-b74f-933741d9f7ab @assert: Subnet is added to the org @CaseLevel: Integration """ org = make_org() new_subnet = make_subnet() Org.add_subnet({ 'name': org['name'], 'subnet-id': new_subnet['id'], }) org = Org.info({'id': org['id']}) self.assertIn(new_subnet['name'], org['subnets'][0])
def test_positive_add_subnet_by_name(self): """Add a subnet to organization by its name @id: 1f464eba-d024-4f37-87c2-5cfff1ac1e23 @Assert: Subnet is added to the org @CaseLevel: Integration """ for name in valid_data_list(): with self.subTest(name): org = make_org() new_subnet = make_subnet({'name': name}) Org.add_subnet({ 'name': org['name'], 'subnet': new_subnet['name'], }) org = Org.info({'id': org['id']}) self.assertIn(name, org['subnets'][0])
def test_positive_add_subnet_by_id(self): """@test: Add a subnet by its ID @feature: Organization @assert: Subnet is added to the org """ for name in (gen_string('alpha'), gen_string('numeric'), gen_string('alphanumeric'), gen_string('utf8'), gen_string('latin1')): with self.subTest(name): org = make_org() new_subnet = make_subnet({'name': name}) Org.add_subnet({ 'name': org['name'], 'subnet-id': new_subnet['id'], }) org = Org.info({'id': org['id']}) self.assertIn(name, org['subnets'][0])
def test_positive_add_and_remove_subnets(self): """add and remove a subnet from organization :id: adb5310b-76c5-4aca-8220-fdf0fe605cb0 :bz: 1. Add and remove subnet by name 2. Add and remove subnet by id :expectedresults: Subnets are handled as expected :bz: 1395229 :CaseLevel: Integration """ org = make_org() subnet_a = make_subnet() subnet_b = make_subnet() Org.add_subnet({ 'name': org['name'], 'subnet': subnet_a['name'], }) Org.add_subnet({ 'name': org['name'], 'subnet-id': subnet_b['id'], }) org_info = Org.info({'id': org['id']}) self.assertEqual(len(org_info['subnets']), 2, "Failed to add subnets") Org.remove_subnet({ 'name': org['name'], 'subnet': subnet_a['name'], }) Org.remove_subnet({ 'name': org['name'], 'subnet-id': subnet_b['id'], }) org_info = Org.info({'id': org['id']}) self.assertEqual(len(org_info['subnets']), 0, "Failed to remove subnets")
def test_positive_remove_subnet_by_id(self): """Remove a subnet from organization by its ID @Feature: Organization @Assert: Subnet is removed from the org """ org = make_org() subnet = make_subnet() Org.add_subnet({ 'name': org['name'], 'subnet': subnet['name'], }) org = Org.info({'id': org['id']}) self.assertEqual(len(org['subnets']), 1) self.assertIn(subnet['name'], org['subnets'][0]) Org.remove_subnet({ 'name': org['name'], 'subnet-id': subnet['id'], }) org = Org.info({'id': org['id']}) self.assertEqual(len(org['subnets']), 0)
def test_positive_remove_subnet_by_name(self): """@Test: Add a subnet and then remove it by its name @Feature: Organization @Assert: Subnet is removed from the org """ org = make_org() subnet = make_subnet() Org.add_subnet({ 'name': org['name'], 'subnet': subnet['name'], }) org = Org.info({'id': org['id']}) self.assertEqual(len(org['subnets']), 1) self.assertIn(subnet['name'], org['subnets'][0]) Org.remove_subnet({ 'name': org['name'], 'subnet': subnet['name'], }) org = Org.info({'id': org['id']}) self.assertEqual(len(org['subnets']), 0)
def test_positive_add_and_remove_subnets(module_org): """add and remove a subnet from organization :id: adb5310b-76c5-4aca-8220-fdf0fe605cb0 :BZ: 1. Add and remove subnet by name 2. Add and remove subnet by id :expectedresults: Subnets are handled as expected :BZ: 1395229 :CaseLevel: Integration """ subnets = [make_subnet() for _ in range(0, 2)] Org.add_subnet({'name': module_org.name, 'subnet': subnets[0]['name']}) Org.add_subnet({'name': module_org.name, 'subnet-id': subnets[1]['id']}) org_info = Org.info({'id': module_org.id}) assert len(org_info['subnets']) == 2, "Failed to add subnets" Org.remove_subnet({'name': module_org.name, 'subnet': subnets[0]['name']}) Org.remove_subnet({'name': module_org.name, 'subnet-id': subnets[1]['id']}) org_info = Org.info({'id': module_org.id}) assert len(org_info['subnets']) == 0, "Failed to remove subnets"
def test_positive_remove_subnet_by_id(self): """Remove a subnet from organization by its ID @id: 4868ef18-983a-48b4-940a-e1b55f01f0b6 @Assert: Subnet is removed from the org @CaseLevel: Integration """ org = make_org() subnet = make_subnet() Org.add_subnet({ 'name': org['name'], 'subnet': subnet['name'], }) org = Org.info({'id': org['id']}) self.assertEqual(len(org['subnets']), 1) self.assertIn(subnet['name'], org['subnets'][0]) Org.remove_subnet({ 'name': org['name'], 'subnet-id': subnet['id'], }) org = Org.info({'id': org['id']}) self.assertEqual(len(org['subnets']), 0)
def test_positive_remove_subnet_by_name(self): """Remove a subnet from organization by its name @id: adb5310b-76c5-4aca-8220-fdf0fe605cb0 @Assert: Subnet is removed from the org @CaseLevel: Integration """ org = make_org() subnet = make_subnet() Org.add_subnet({ 'name': org['name'], 'subnet': subnet['name'], }) org = Org.info({'id': org['id']}) self.assertEqual(len(org['subnets']), 1) self.assertIn(subnet['name'], org['subnets'][0]) Org.remove_subnet({ 'name': org['name'], 'subnet': subnet['name'], }) org = Org.info({'id': org['id']}) self.assertEqual(len(org['subnets']), 0)