import unittest
from dnnamo.core.graph import DnnamoGraph
from .synthetic_graph import SynthOp, SynthTensor, ConstructRandomGraph


class TestGenericGraph(unittest.TestCase):

    def test_instantiation(self):
        _ = DnnamoGraph()

    def test_iteration(self):
        N_OPS = 7
        N_TS = 10
        with ConstructRandomGraph(N_OPS, N_TS) as g:
            assert len(g.ops) == N_OPS
            for op in g.ops:
                assert op.type == 'Synth', 'Invalid operation found.'
                assert isinstance(op, SynthOp
                    ), 'Corrupted tensor object: ' + str(op)
            assert len(g.tensors) == N_TS
            for t in g.tensors:
                assert isinstance(t, SynthTensor
                    ), 'Corrupted tensor object: ' + str(t)

db355face88bcfaf60169c1e767f3c567c40cea1
<mask token>


class TestGenericGraph(unittest.TestCase):
    <mask token>
    <mask token>

<mask token>


class TestGenericGraph(unittest.TestCase):
    <mask token>

    def test_iteration(self):
        N_OPS = 7
        N_TS = 10
        with ConstructRandomGraph(N_OPS, N_TS) as g:
            assert len(g.ops) == N_OPS
            for op in g.ops:
                assert op.type == 'Synth', 'Invalid operation found.'
                assert isinstance(op, SynthOp
                    ), 'Corrupted tensor object: ' + str(op)
            assert len(g.tensors) == N_TS
            for t in g.tensors:
                assert isinstance(t, SynthTensor
                    ), 'Corrupted tensor object: ' + str(t)

<mask token>


class TestGenericGraph(unittest.TestCase):

    def test_instantiation(self):
        _ = DnnamoGraph()

    def test_iteration(self):
        N_OPS = 7
        N_TS = 10
        with ConstructRandomGraph(N_OPS, N_TS) as g:
            assert len(g.ops) == N_OPS
            for op in g.ops:
                assert op.type == 'Synth', 'Invalid operation found.'
                assert isinstance(op, SynthOp
                    ), 'Corrupted tensor object: ' + str(op)
            assert len(g.tensors) == N_TS
            for t in g.tensors:
                assert isinstance(t, SynthTensor
                    ), 'Corrupted tensor object: ' + str(t)

import unittest
from dnnamo.core.graph import DnnamoGraph
from .synthetic_graph import SynthOp, SynthTensor, ConstructRandomGraph


class TestGenericGraph(unittest.TestCase):

    def test_instantiation(self):
        _ = DnnamoGraph()

    def test_iteration(self):
        N_OPS = 7
        N_TS = 10
        with ConstructRandomGraph(N_OPS, N_TS) as g:
            assert len(g.ops) == N_OPS
            for op in g.ops:
                assert op.type == 'Synth', 'Invalid operation found.'
                assert isinstance(op, SynthOp
                    ), 'Corrupted tensor object: ' + str(op)
            assert len(g.tensors) == N_TS
            for t in g.tensors:
                assert isinstance(t, SynthTensor
                    ), 'Corrupted tensor object: ' + str(t)
