Skip to content
Snippets Groups Projects
Commit fa602bcd authored by Erik Reid's avatar Erik Reid
Browse files

re-enable tests with update data data

parent 49b1dc00
No related branches found
No related tags found
No related merge requests found
...@@ -48,27 +48,26 @@ def test_router_interfaces(router, client_with_mocked_data): ...@@ -48,27 +48,26 @@ def test_router_interfaces(router, client_with_mocked_data):
def test_snmp_ids(router, client_with_mocked_data): def test_snmp_ids(router, client_with_mocked_data):
# snmp_id_list_schema = { snmp_id_list_schema = {
# "$schema": "http://json-schema.org/draft-07/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
# "type": "array", "type": "array",
# "items": { "items": {
# "type": "object", "type": "object",
# "properties": { "properties": {
# "index": {"type": "string"}, "index": {"type": "integer"},
# "name": {"type": "string"} "name": {"type": "string"}
# }, },
# "required": ["index", "name"], "required": ["index", "name"],
# "additionalProperties": False "additionalProperties": False
# } }
# } }
rv = client_with_mocked_data.post( rv = client_with_mocked_data.post(
"/testing/snmp/" + router, "/testing/snmp/" + router,
headers=DEFAULT_REQUEST_HEADERS) headers=DEFAULT_REQUEST_HEADERS)
response = json.loads(rv.data.decode("utf-8")) response = json.loads(rv.data.decode("utf-8"))
# TODO: rebuild sample database ... jsonschema.validate(response, snmp_id_list_schema)
# jsonschema.validate(response, snmp_id_list_schema)
assert response # at least shouldn't be empty assert response # at least shouldn't be empty
......
# import json import json
# import jsonschema import jsonschema
#
# DEFAULT_REQUEST_HEADERS = { DEFAULT_REQUEST_HEADERS = {
# "Content-type": "application/json", "Content-type": "application/json",
# "Accept": ["application/json"] "Accept": ["application/json"]
# } }
def test_router_interfaces(router, client_with_mocked_data): def test_router_interfaces(router, client_with_mocked_data):
return interfaces_list_schema = {
# interfaces_list_schema = { "$schema": "http://json-schema.org/draft-07/schema#",
# "$schema": "http://json-schema.org/draft-07/schema#",
# "definitions": {
# "definitions": { "circuit": {
# "circuit": { "type": "object",
# "type": "object", "properties": {
# "properties": { "name": {"type": "string"},
# "name": {"type": "string"}, "status": {"type": "string"},
# "status": {"type": "string"}, "type": {"type": "string"},
# "type": {"type": "string"}, "id": {"type": "integer"}
# "id": {"type": "integer"} },
# }, "required": ["name", "status", "type", "id"],
# "required": ["name", "status", "type", "id"], "additionalProperties": False
# "additionalProperties": False }
# } },
# },
# "type": "array",
# "type": "array", "items": {
# "items": { "type": "object",
# "type": "object", "properties": {
# "properties": { "circuits": {
# "circuits": { "type": "array",
# "type": "array", "items": {"$ref": "#/definitions/circuit"}
# "items": {"$ref": "#/definitions/circuit"} },
# }, "bundle": {
# "bundle": { "type": "array",
# "type": "array", "items": {"type": "string"}
# "items": {"type": "string"} },
# }, "bundle-parents": {
# "bundle-parents": { "type": "array",
# "type": "array", "items": {"type": "string"}
# "items": {"type": "string"} },
# }, "description": {"type": "string"},
# "description": {"type": "string"}, "name": {"type": "string"},
# "name": {"type": "string"}, "snmp-index": {"type": "integer"}
# "snmp-index": {"type": "integer"} },
# }, "required": [
# "required": [ "circuits",
# "circuits", "bundle",
# "bundle", "bundle-parents",
# "bundle-parents", "description",
# "description", "name",
# "name", "snmp-index"],
# "snmp-index"], "additionalProperties": False
# "additionalProperties": False }
# } }
# }
# rv = client_with_mocked_data.post(
# rv = client_with_mocked_data.post( "/poller/interfaces/" + router,
# "/poller/interfaces/" + router, headers=DEFAULT_REQUEST_HEADERS)
# headers=DEFAULT_REQUEST_HEADERS)
# assert rv.status_code == 200
# assert rv.status_code == 200 response = json.loads(rv.data.decode("utf-8"))
# response = json.loads(rv.data.decode("utf-8")) jsonschema.validate(response, interfaces_list_schema)
# jsonschema.validate(response, interfaces_list_schema) assert response # at least shouldn't be empty
# assert response # at least shouldn't be empty
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment