import json
from jsonschema import validate


def validate_schema(data, schema_file):
    with open(schema_file) as file:
        schema = json.load(file)
    return validate(instance=data, schema=schema)


def test_get_todos(session, base_url, fixture_get_todos):
    res = session.get(url=base_url)
    validate_schema(res.json(), fixture_get_todos)


def test_get_todo(session, base_url):
    res = session.get(url=f'{base_url}/1')
    validate_schema(res.json(), "lesson4/schemas/todo_schema.json")

9b5d4805d3cb32796803ca418890da0a579d2dd7
<mask token>


def test_get_todo(session, base_url):
    res = session.get(url=f'{base_url}/1')
    validate_schema(res.json(), 'lesson4/schemas/todo_schema.json')

<mask token>


def validate_schema(data, schema_file):
    with open(schema_file) as file:
        schema = json.load(file)
    return validate(instance=data, schema=schema)


<mask token>


def test_get_todo(session, base_url):
    res = session.get(url=f'{base_url}/1')
    validate_schema(res.json(), 'lesson4/schemas/todo_schema.json')

<mask token>


def validate_schema(data, schema_file):
    with open(schema_file) as file:
        schema = json.load(file)
    return validate(instance=data, schema=schema)


def test_get_todos(session, base_url, fixture_get_todos):
    res = session.get(url=base_url)
    validate_schema(res.json(), fixture_get_todos)


def test_get_todo(session, base_url):
    res = session.get(url=f'{base_url}/1')
    validate_schema(res.json(), 'lesson4/schemas/todo_schema.json')

import json
from jsonschema import validate


def validate_schema(data, schema_file):
    with open(schema_file) as file:
        schema = json.load(file)
    return validate(instance=data, schema=schema)


def test_get_todos(session, base_url, fixture_get_todos):
    res = session.get(url=base_url)
    validate_schema(res.json(), fixture_get_todos)


def test_get_todo(session, base_url):
    res = session.get(url=f'{base_url}/1')
    validate_schema(res.json(), 'lesson4/schemas/todo_schema.json')

import json
from jsonschema import validate


def validate_schema(data, schema_file):
    with open(schema_file) as file:
        schema = json.load(file)
    return validate(instance=data, schema=schema)


def test_get_todos(session, base_url, fixture_get_todos):
    res = session.get(url=base_url)
    validate_schema(res.json(), fixture_get_todos)


def test_get_todo(session, base_url):
    res = session.get(url=f'{base_url}/1')
    validate_schema(res.json(), "lesson4/schemas/todo_schema.json")
