# Path: aioconsul/encoders/json.py
# class Registry:
# class MappingEncoder:
# class SequenceEncoder:
# class RFC3339Encoder:
# class DurationEncoder:
# class HiddenEncoder:
# class Encoder(json.JSONEncoder):
#     def __init__(self):
#     def encode(self, obj, **kwargs):
#     def decode(self, dct, **kwargs):
#     def register(self, hook):
#     def encode(self, obj):
#     def encode(self, obj):
#     def encode(self, obj):
#     def decode(self, dct):
#     def encode(self, obj):
#     def decode(self, dct):
#     def decode(self, dct):
#     def default(self, obj):
# def dumps(obj, **kwargs):
# def loads(obj, **kwargs):


import pytest
from json import dumps
from aioconsul.encoders import json
from datetime import datetime, timedelta


@pytest.mark.parametrize("input, expected", [
    (timedelta(seconds=10), "10s"),
    (datetime(2016, 12, 11), "2016-12-11T00:00:00"),
    ("foo", "foo"),
], ids=["duration", "datetime", "string"])
def test_json(input, expected):

# Path: aioconsul/encoders/json.py
# class Registry:
# class MappingEncoder:
# class SequenceEncoder:
# class RFC3339Encoder:
# class DurationEncoder:
# class HiddenEncoder:
# class Encoder(json.JSONEncoder):
#     def __init__(self):
#     def encode(self, obj, **kwargs):
#     def decode(self, dct, **kwargs):
#     def register(self, hook):
#     def encode(self, obj):
#     def encode(self, obj):
#     def encode(self, obj):
#     def decode(self, dct):
#     def encode(self, obj):
#     def decode(self, dct):
#     def decode(self, dct):
#     def default(self, obj):
# def dumps(obj, **kwargs):
# def loads(obj, **kwargs):


# Path: tests/test_json.py
import pytest
from json import dumps
from aioconsul.encoders import json
from datetime import datetime, timedelta



@pytest.mark.parametrize("input, expected", [
    (timedelta(seconds=10), "10s"),
    (datetime(2016, 12, 11), "2016-12-11T00:00:00"),
    ("foo", "foo"),
], ids=["duration", "datetime", "string"])
def test_json(input, expected):

    assert json.dumps(input) == dumps(expected)