diff options
author | 2017-07-27 15:04:07 +0000 | |
---|---|---|
committer | 2017-07-27 15:04:07 +0000 | |
commit | 162c03ef301396072c1934e7e7e0c40a841b4fe2 (patch) | |
tree | 7a2a2781949252436450ff5832962785061a774a /app/test/api/responders_test/test_data/base.py | |
parent | b88c78e3cf2bef22aa2f1c4d0bf305e303bc15f0 (diff) | |
parent | 7e83d0876ddb84a45e130eeba28bc40ef53c074b (diff) |
Merge "Calipso initial release for OPNFV"
Diffstat (limited to 'app/test/api/responders_test/test_data/base.py')
-rw-r--r-- | app/test/api/responders_test/test_data/base.py | 179 |
1 files changed, 179 insertions, 0 deletions
diff --git a/app/test/api/responders_test/test_data/base.py b/app/test/api/responders_test/test_data/base.py new file mode 100644 index 0000000..1e85800 --- /dev/null +++ b/app/test/api/responders_test/test_data/base.py @@ -0,0 +1,179 @@ +############################################################################### +# Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) # +# and others # +# # +# All rights reserved. This program and the accompanying materials # +# are made available under the terms of the Apache License, Version 2.0 # +# which accompanies this distribution, and is available at # +# http://www.apache.org/licenses/LICENSE-2.0 # +############################################################################### +# HTTP status code +SUCCESSFUL_CODE = "200" +NOT_FOUND_CODE = "404" +CONFLICT_CODE = "409" +BAD_REQUEST_CODE = "400" +UNAUTHORIZED_CODE = "401" +CREATED_CODE = "201" + +ENV_NAME = "Mirantis-Liberty-API" +UNKNOWN_ENV = "Unkown-Environment" +NON_INT_PAGE = 1.4 +INT_PAGE = 1 +NON_INT_PAGESIZE = 2.4 +INT_PAGESIZE = 2 + +WRONG_LINK_TYPE = "instance-host" +CORRECT_LINK_TYPE= "instance-vnic" + +WRONG_LINK_STATE = "wrong" +CORRECT_LINK_STATE = "up" + +WRONG_SCAN_STATUS = "error" +CORRECT_SCAN_STATUS = "completed" + +WRONG_MONITORING_SIDE = "wrong-side" +CORRECT_MONITORING_SIDE = "client" + +WRONG_MESSAGE_SEVERITY = "wrong-severity" +CORRECT_MESSAGE_SEVERITY = "warn" + +WRONG_TYPE_DRIVER = "wrong_type" +CORRECT_TYPE_DRIVER = "local" + +WRONG_MECHANISM_DRIVER = "wrong-mechanism-dirver" +CORRECT_MECHANISM_DRIVER = "ovs" + +WRONG_LOG_LEVEL = "wrong-log-level" +CORRECT_LOG_LEVEL = "critical" + +WRONG_OBJECT_TYPE = "wrong-object-type" +CORRECT_OBJECT_TYPE = "vnic" + +WRONG_ENV_TYPE = "" +CORRECT_ENV_TYPE = "development" + +WRONG_DISTRIBUTION = "wrong-environment" +CORRECT_DISTRIBUTION = "Mirantis-6.0" + +WRONG_OBJECT_ID = "58a2406e6a283a8bee15d43" +CORRECT_OBJECT_ID = "58a2406e6a283a8bee15d43f" + +WRONG_FORMAT_TIME = "2017-01-25T23:34:333+TX0012" +CORRECT_FORMAT_TIME = "2017-01-25T14:28:32.400Z" + +NON_BOOL = "falses" +BOOL = False +NON_DICT_OBJ = "" + +# fake constants +CONSTANTS_BY_NAMES = { + "link_types": [ + "instance-vnic", + "otep-vconnector", + "otep-pnic", + "pnic-network", + "vedge-otep", + "vnic-vconnector", + "vconnector-pnic", + "vconnector-vedge", + "vnic-vedge", + "vedge-pnic", + "vservice-vnic" + ], + "link_states": [ + "up", + "down" + ], + "scan_statuses": [ + "draft", + "pending", + "running", + "completed", + "failed", + "aborted" + ], + "monitoring_sides": [ + "client", + "server" + ], + "messages_severity": [ + "panic", + "alert", + "crit", + "error", + "warn", + "notice", + "info", + "debug" + ], + "type_drivers": [ + "local", + "vlan", + "vxlan", + "gre", + "flat" + ], + "mechanism_drivers": [ + "ovs", + "vpp", + "LinuxBridge", + "Arista", + "Nexus" + ], + "log_levels": [ + "critical", + "error", + "warning", + "info", + "debug", + "notset" + ], + "object_types": [ + "vnic", + "vconnector", + "vedge", + "instance", + "vservice", + "pnic", + "network", + "port", + "otep", + "agent" + ], + "env_types": [ + "development", + "testing", + "staging", + "production" + ], + "distributions": [ + "Mirantis-6.0", + "Mirantis-7.0", + "Mirantis-8.0", + "Mirantis-9.0", + "RDO-Juno" + ], + "environment_operational_status": [ + "stopped", + "running", + "error" + ], + "environment_provision_types": [ + "None", + "Deploy", + "Files", + "DB" + ], + "environment_monitoring_types": [ + "Sensu" + ] +} + +# path info +RESPONDER_BASE_PATH = "api.responders.responder_base.ResponderBase" +RESPONDER_BASE_GET_OBJECTS_LIST = RESPONDER_BASE_PATH + ".get_objects_list" +RESPONDER_BASE_GET_OBJECT_BY_ID = RESPONDER_BASE_PATH + ".get_object_by_id" +RESPONDER_BASE_CHECK_ENVIRONMENT_NAME = RESPONDER_BASE_PATH + ".check_environment_name" +RESPONDER_BASE_READ = RESPONDER_BASE_PATH + ".read" +RESPONDER_BASE_WRITE = RESPONDER_BASE_PATH + ".write" +RESPONDER_BASE_AGGREGATE = RESPONDER_BASE_PATH + ".aggregate" |