# -*- coding: utf-8 -*-
# Copyright 2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from __future__ import unicode_literals

import pytest


@pytest.fixture
def avro_schema_json():
    return {
        "type": "record",
        "name": "test_record",
        "fields": [
            {
                "type": ["null", "int"],
                "name": "union_field"
            },
            {
                "type": ["null", "int"],
                "name": "union_field_null",
                "default": None
            },
            {
                "type": ["null", "int"],
                "name": "union_field_101",
                "default": 101
            },
            {
                "type": "boolean",
                "name": "bool_field"
            },
            {
                "type": "boolean",
                "name": "bool_field_F",
                "default": False
            },
            {
                "type": "string",
                "name": "string_field"
            },
            {
                "type": "string",
                "name": "string_field_foo",
                "default": "foo❤"
            },
            {
                "type": "bytes",
                "name": "bytes_field"
            },
            {
                "type": "bytes",
                "name": "bytes_field_bar",
                "default": "bar"
            },
            {
                "type": "int",
                "name": "int_field"
            },
            {
                "type": "int",
                "name": "int_field_1",
                "default": 1
            },
            {
                "type": "long",
                "name": "long_field"
            },
            {
                "type": "long",
                "name": "long_field_42",
                "default": 42
            },
            {
                "type": "float",
                "name": "float_field"
            },
            {
                "type": "float",
                "name": "float_field_p75",
                "default": 0.75
            },
            {
                "type": "double",
                "name": "double_field"
            },
            {
                "type": "double",
                "name": "double_field_pi",
                "default": 3.14
            }
        ]
    }
