Skip to content
Snippets Groups Projects
test_mic_routes.py 497 B
import json

import jsonschema

from inventory_provider.routes.mic import ALL_DATA_SCHEMA

DEFAULT_REQUEST_HEADERS = {
    "Content-type": "application/json",
    "Accept": ["application/json"]
}


def test_get_all_data(client, mocked_redis):
    rv = client.get(
        '/mic/all-data',
        headers=DEFAULT_REQUEST_HEADERS)
    assert rv.status_code == 200
    assert rv.is_json
    response_data = json.loads(rv.data.decode('utf-8'))
    jsonschema.validate(response_data, ALL_DATA_SCHEMA)