def test_positive_remove_parameter_by_loc_id(self): """Remove a parameter from location :id: 13836073-3e39-4d3e-b4b4-e87619c28bae :expectedresults: Parameter is removed from the location :CaseImportance: Critical """ param_name = gen_string('alpha') location = make_location() Location.set_parameter({ 'name': param_name, 'value': gen_string('alpha'), 'location-id': location['id'], }) location = Location.info({'id': location['id']}) self.assertEqual(len(location['parameters']), 1) Location.delete_parameter({ 'name': param_name, 'location-id': location['id'], }) location = Location.info({'id': location['id']}) self.assertEqual(len(location['parameters']), 0) self.assertNotIn(param_name.lower(), location['parameters'])
def test_positive_remove_parameter_by_loc_name(self): """Remove a parameter from location :id: 97fda466-1894-431e-bc76-3b1c7643522f :expectedresults: Parameter is removed from the location :CaseImportance: Critical """ param_name = gen_string('alpha') location = make_location() Location.set_parameter({ 'name': param_name, 'value': gen_string('alpha'), 'location': location['name'], }) location = Location.info({'id': location['id']}) self.assertEqual(len(location['parameters']), 1) Location.delete_parameter({ 'name': param_name, 'location': location['name'], }) location = Location.info({'id': location['id']}) self.assertEqual(len(location['parameters']), 0) self.assertNotIn(param_name.lower(), location['parameters'])
def test_positive_add_update_remove_parameter(self, request): """Add, update and remove parameter to location :id: 61b564f2-a42a-48de-833d-bec3a127d0f5 :expectedresults: Parameter is added to the location :CaseImportance: Critical """ # Create param_name = gen_string('alpha') param_value = gen_string('alpha') param_new_value = gen_string('alpha') location = _location(request) Location.set_parameter( {'name': param_name, 'value': param_value, 'location-id': location['id']} ) location = Location.info({'id': location['id']}) assert len(location['parameters']) == 1 assert param_value == location['parameters'][param_name.lower()] # Update Location.set_parameter( {'name': param_name, 'value': param_new_value, 'location': location['name']} ) location = Location.info({'id': location['id']}) assert len(location['parameters']) == 1 assert param_new_value == location['parameters'][param_name.lower()] # Remove Location.delete_parameter({'name': param_name, 'location': location['name']}) location = Location.info({'id': location['id']}) assert len(location['parameters']) == 0 assert param_name.lower() not in location['parameters']
def test_positive_add_update_remove_parameter(self): """Add, update and remove parameter to location :id: 61b564f2-a42a-48de-833d-bec3a127d0f5 :expectedresults: Parameter is added to the location :CaseImportance: Critical """ # Create param_name = gen_string('alpha') param_value = gen_string('alpha') param_new_value = gen_string('alpha') location = make_location() Location.set_parameter( {'name': param_name, 'value': param_value, 'location-id': location['id']} ) location = Location.info({'id': location['id']}) self.assertEqual(len(location['parameters']), 1) self.assertEqual(param_value, location['parameters'][param_name.lower()]) # Update Location.set_parameter( {'name': param_name, 'value': param_new_value, 'location': location['name']} ) location = Location.info({'id': location['id']}) self.assertEqual(len(location['parameters']), 1) self.assertEqual(param_new_value, location['parameters'][param_name.lower()]) # Remove Location.delete_parameter({'name': param_name, 'location': location['name']}) location = Location.info({'id': location['id']}) self.assertEqual(len(location['parameters']), 0) self.assertNotIn(param_name.lower(), location['parameters'])
def test_positive_remove_parameter_by_loc_id(self): """Remove a parameter from location :id: 13836073-3e39-4d3e-b4b4-e87619c28bae :expectedresults: Parameter is removed from the location :CaseImportance: Critical """ param_name = gen_string('alpha') location = make_location() Location.set_parameter({ 'name': param_name, 'value': gen_string('alpha'), 'location-id': location['id'], }) location = Location.info({'id': location['id']}) self.assertEqual(len(location['parameters']), 1) Location.delete_parameter({ 'name': param_name, 'location-id': location['id'], }) location = Location.info({'id': location['id']}) self.assertEqual(len(location['parameters']), 0) self.assertNotIn(param_name.lower(), location['parameters'])
def test_positive_remove_parameter_by_loc_name(self): """Remove a parameter from location :id: 97fda466-1894-431e-bc76-3b1c7643522f :expectedresults: Parameter is removed from the location :CaseImportance: Critical """ param_name = gen_string('alpha') location = make_location() Location.set_parameter({ 'name': param_name, 'value': gen_string('alpha'), 'location': location['name'], }) location = Location.info({'id': location['id']}) self.assertEqual(len(location['parameters']), 1) Location.delete_parameter({ 'name': param_name, 'location': location['name'], }) location = Location.info({'id': location['id']}) self.assertEqual(len(location['parameters']), 0) self.assertNotIn(param_name.lower(), location['parameters'])