# Path: robograph/datamodel/base/graph.py
# class Graph:
#     def __init__(self, name, nodes=None):
#     def root_node(self):
#     def nodes(self):
#     def edges(self):
#     def nxgraph(self):
#     def name(self):
#     def add_node(self, node):
#     def add_nodes(self, sequence_of_nodes):
#     def remove_node(self, node):
#     def remove_nodes(self, sequence_of_nodes):
#     def connect(self, node_from, node_to, output_label):
#     def has_isles(self):
#     def execute(self, result_label="result"):
#     def reset(self):
#     def __repr__(self):
#     def __len__(self):
# 
# Path: robograph/datamodel/nodes/serializer.py
# class NodeDeserializationException(Exception):
# class NodeSerializer:
# class GraphDeserializationException(Exception):
# class GraphSerializer:
#     def to_dict(cls, node):
#     def from_dict(cls, node_dict):
#     def serialize(cls, node):
#     def deserialize(cls, json_string):
#     def to_dict(cls, graph):
#         def _get_id(seq, node):
#     def serialize(cls, graph):
#     def deserialize(cls, json_string):
# 
# Path: robograph/datamodel/nodes/lib/value.py
# class Value(node.Node):
#     def output(self):
# 
# Path: robograph/datamodel/nodes/lib/buffers.py
# class Buffer(node.Node):
# class DelayedBuffer(Buffer):
#     def __init__(self, **args):
#     def input(self, context):
#     def output(self):
#     def reset(self):
#     def output(self):
# 
# Path: robograph/datamodel/nodes/lib/apply.py
# class Apply(node.Node):
#     def output(self):


from robograph.datamodel.base import graph
from robograph.datamodel.nodes import serializer
from robograph.datamodel.nodes.lib import value, buffers, apply


def test_node_serializer():
    instance = apply.Apply(function=lambda x: x + 2, argument=3, name='test')
    serialized = serializer.NodeSerializer.serialize(instance)
    deserialized = serializer.NodeSerializer.deserialize(serialized)
    assert instance.name == deserialized.name
    assert instance.output_label == deserialized.output_label
    assert instance.output() == deserialized.output()


def test_graph_serializer():

# Path: robograph/datamodel/base/graph.py
# class Graph:
#     def __init__(self, name, nodes=None):
#     def root_node(self):
#     def nodes(self):
#     def edges(self):
#     def nxgraph(self):
#     def name(self):
#     def add_node(self, node):
#     def add_nodes(self, sequence_of_nodes):
#     def remove_node(self, node):
#     def remove_nodes(self, sequence_of_nodes):
#     def connect(self, node_from, node_to, output_label):
#     def has_isles(self):
#     def execute(self, result_label="result"):
#     def reset(self):
#     def __repr__(self):
#     def __len__(self):
# 
# Path: robograph/datamodel/nodes/serializer.py
# class NodeDeserializationException(Exception):
# class NodeSerializer:
# class GraphDeserializationException(Exception):
# class GraphSerializer:
#     def to_dict(cls, node):
#     def from_dict(cls, node_dict):
#     def serialize(cls, node):
#     def deserialize(cls, json_string):
#     def to_dict(cls, graph):
#         def _get_id(seq, node):
#     def serialize(cls, graph):
#     def deserialize(cls, json_string):
# 
# Path: robograph/datamodel/nodes/lib/value.py
# class Value(node.Node):
#     def output(self):
# 
# Path: robograph/datamodel/nodes/lib/buffers.py
# class Buffer(node.Node):
# class DelayedBuffer(Buffer):
#     def __init__(self, **args):
#     def input(self, context):
#     def output(self):
#     def reset(self):
#     def output(self):
# 
# Path: robograph/datamodel/nodes/lib/apply.py
# class Apply(node.Node):
#     def output(self):


# Path: robograph/datamodel/tests/test_serializer.py
from robograph.datamodel.base import graph
from robograph.datamodel.nodes import serializer
from robograph.datamodel.nodes.lib import value, buffers, apply



def test_node_serializer():
    instance = apply.Apply(function=lambda x: x + 2, argument=3, name='test')
    serialized = serializer.NodeSerializer.serialize(instance)
    deserialized = serializer.NodeSerializer.deserialize(serialized)
    assert instance.name == deserialized.name
    assert instance.output_label == deserialized.output_label
    assert instance.output() == deserialized.output()


def test_graph_serializer():

    a = value.Value(value=1, name='val_a')