def test_negative_realm_update_invalid_type( subscribe_satellite, enroll_idm_and_configure_external_auth, configure_realm, module_fake_proxy, request, ): """Test updating realm with an invalid type :id: 3097f8e5-9152-4d8d-9991-969bdfc9c4d4 :expectedresults: Realm is not updated """ realm_type = 'Red Hat Identity Management' new_realm_type = gen_string('alpha') realm = make_realm({ 'name': gen_string('alpha', random.randint(1, 30)), 'realm-proxy-id': module_fake_proxy.id, 'realm-type': realm_type, 'locations': [loc.read().name for loc in module_fake_proxy.location], }) request.addfinalizer(lambda: realm_cleanup(realm['id'])) with pytest.raises(CLIReturnCodeError): Realm.update({'id': realm['id'], 'realm-type': new_realm_type})
def test_positive_realm_update_name( subscribe_satellite, enroll_idm_and_configure_external_auth, configure_realm, module_fake_proxy, request, ): """Test updating realm name :id: c09e6599-c77a-4290-ac93-311d06e3d860 :expectedresults: Realm name can be updated """ realm_name = gen_string('alpha', random.randint(1, 30)) new_realm_name = gen_string('alpha', random.randint(1, 30)) realm = make_realm({ 'name': realm_name, 'realm-proxy-id': module_fake_proxy.id, 'realm-type': 'Red Hat Identity Management', 'locations': [loc.read().name for loc in module_fake_proxy.location], }) request.addfinalizer(lambda: realm_cleanup(realm['id'])) assert realm['name'] == realm_name up = Realm.update({'id': realm['id'], 'new-name': new_realm_name}) assert up[0]['message'] == f'Realm [{new_realm_name}] updated.' info = Realm.info({'id': realm['id']}) assert info['name'] == new_realm_name
def test_negative_realm_update_invalid_type(self, _make_proxy): """Test updating realm with an invalid type :id: 3097f8e5-9152-4d8d-9991-969bdfc9c4d4 :expectedresults: Realm is not updated """ realm_type = 'Red Hat Identity Management' new_realm_type = gen_string('alpha') proxy = _make_proxy realm = make_realm({ 'name': gen_string('alpha', random.randint(1, 30)), 'realm-proxy-id': proxy['id'], 'realm-type': realm_type, 'locations': proxy['locations'], }) with pytest.raises(CLIReturnCodeError): Realm.update({'id': realm['id'], 'realm-type': new_realm_type})
def test_negative_realm_update_invalid_type(self): """Test updating realm with an invalid type :id: 3097f8e5-9152-4d8d-9991-969bdfc9c4d4 :expectedresults: Realm is not updated """ realm_type = 'Red Hat Identity Management' new_realm_type = gen_string('alpha') proxy = self._make_proxy() self.realm = make_realm({ 'name': self.realm_name, 'realm-proxy-id': proxy['id'], 'realm-type': realm_type, 'locations': proxy['locations'] }) with self.assertRaises(CLIReturnCodeError): Realm.update({ 'id': self.realm['id'], 'realm-type': new_realm_type })
def test_negative_realm_update_invalid_type(self): """Test updating realm with an invalid type :id: 3097f8e5-9152-4d8d-9991-969bdfc9c4d4 :expectedresults: Realm is not updated """ realm_type = 'Red Hat Identity Management' new_realm_type = gen_string('alpha') proxy = self._make_proxy() self.realm = make_realm({ 'name': self.realm_name, 'realm-proxy-id': proxy['id'], 'realm-type': realm_type, 'locations': proxy['locations'] }) with self.assertRaises(CLIReturnCodeError): Realm.update({ 'id': self.realm['id'], 'realm-type': new_realm_type })
def test_positive_realm_update_name(self, _make_proxy): """Test updating realm name :id: c09e6599-c77a-4290-ac93-311d06e3d860 :expectedresults: Realm name can be updated """ realm_name = gen_string('alpha', random.randint(1, 30)) new_realm_name = gen_string('alpha', random.randint(1, 30)) proxy = _make_proxy realm = make_realm({ 'name': realm_name, 'realm-proxy-id': proxy['id'], 'realm-type': 'Red Hat Identity Management', 'locations': proxy['locations'], }) assert realm['name'] == realm_name up = Realm.update({'id': realm['id'], 'new-name': new_realm_name}) assert up[0]['message'] == f'Realm [{new_realm_name}] updated.' info = Realm.info({'id': realm['id']}) assert info['name'] == new_realm_name
def test_positive_realm_update_name(self): """Test updating realm name :id: c09e6599-c77a-4290-ac93-311d06e3d860 :expectedresults: Realm name can be updated """ realm_name = gen_string('alphanumeric') new_realm_name = self.realm_name proxy = self._make_proxy() self.realm = make_realm({ 'name': realm_name, 'realm-proxy-id': proxy['id'], 'realm-type': 'Red Hat Identity Management', 'locations': proxy['locations'], }) self.assertEquals(self.realm['name'], realm_name) up = Realm.update({'id': self.realm['id'], 'new-name': new_realm_name}) self.assertEquals(up[0]['message'], 'Realm [{0}] updated.'.format(new_realm_name)) info = Realm.info({'id': self.realm['id']}) self.assertEquals(info['name'], new_realm_name)
def test_positive_realm_update_name(self): """Test updating realm name :id: c09e6599-c77a-4290-ac93-311d06e3d860 :expectedresults: Realm name updated """ realm_name = gen_string('alphanumeric') new_realm_name = self.realm_name proxy = self._make_proxy() self.realm = make_realm({ 'name': realm_name, 'realm-proxy-id': proxy['id'], 'realm-type': 'Red Hat Identity Management', 'locations': proxy['locations'] }) self.assertEquals(self.realm['name'], realm_name) up = Realm.update({'id': self.realm['id'], 'new-name': new_realm_name}) self.assertEquals( up[0]['message'], 'Realm [{0}] updated.'.format(new_realm_name) ) info = Realm.info({'id': self.realm['id']}) self.assertEquals(info['name'], new_realm_name)