# Path: pymco/serializers/yaml.py
# def ruby_object_constructor(loader, suffix, node):
# def symbol_constructor(loader, node):
#     def __init__(self):
#     def serialize(self, msg):
#     def deserialize(self, msg):
# class RubyCompatibleLoader(yaml.SafeLoader):
# class Serializer(SerializerBase):


import mock
from pymco.serializers import yaml as _yaml
:filter:
  agent: []
  cf_class: []
  compound: []
  fact: []
  identity: []
:msgtime: 123
:requestid: 6ef11a5053008b54c03ca934972fdfa45448439d
:senderid: mco1
:ttl: 60
"""


def test_deserialize(yaml, yaml_response):
    assert yaml.deserialize(yaml_response) == {
        ':senderid': 'mco1',
        ':requestid': '335a3e8261e4589499d366862b328816',
        ':senderagent': 'discovery',
        ':msgtime': 1384022186,
        ':body': 'pong',
    }


def test_symbol_constructor():
    loader, node = mock.Mock(), mock.Mock(value='foo')
    assert _yaml.symbol_constructor(loader, node) == ':foo'


def test_ruby_object_constructor():
    loader, node = mock.Mock(), mock.Mock()

# Path: pymco/serializers/yaml.py
# def ruby_object_constructor(loader, suffix, node):
# def symbol_constructor(loader, node):
#     def __init__(self):
#     def serialize(self, msg):
#     def deserialize(self, msg):
# class RubyCompatibleLoader(yaml.SafeLoader):
# class Serializer(SerializerBase):


# Path: tests/unit/serializers/test_yaml.py
import mock
from pymco.serializers import yaml as _yaml

:filter:
  agent: []
  cf_class: []
  compound: []
  fact: []
  identity: []
:msgtime: 123
:requestid: 6ef11a5053008b54c03ca934972fdfa45448439d
:senderid: mco1
:ttl: 60
"""


def test_deserialize(yaml, yaml_response):
    assert yaml.deserialize(yaml_response) == {
        ':senderid': 'mco1',
        ':requestid': '335a3e8261e4589499d366862b328816',
        ':senderagent': 'discovery',
        ':msgtime': 1384022186,
        ':body': 'pong',
    }


def test_symbol_constructor():
    loader, node = mock.Mock(), mock.Mock(value='foo')
    assert _yaml.symbol_constructor(loader, node) == ':foo'


def test_ruby_object_constructor():
    loader, node = mock.Mock(), mock.Mock()

    assert _yaml.ruby_object_constructor(