Code Duplication    Length = 17-18 lines in 3 locations

tests/graphinate/test_builders.py 3 locations

@@ 60-77 (lines=18) @@
57
    assert graph.graph['name'] == name
58
59
60
def test_networkx_builder_repeating_nodes():
61
    # arrange
62
    name = 'Repeating Nodes'
63
    graph_model = graphinate.GraphModel(name=name)
64
65
    @graph_model.node()
66
    def edge():
67
        for i in range(5):
68
            yield i
69
            yield i
70
71
    # act
72
    builder = graphinate.builders.NetworkxBuilder(graph_model)
73
    graph = builder.build()
74
75
    # assert
76
    assert isinstance(graph, nx.Graph)
77
    assert graph.graph['name'] == name
78
79
80
def test_networkx_builder_repeating_edges():
@@ 120-136 (lines=17) @@
117
    assert graph.graph['name'] == name
118
119
120
def test_networkx_builder__defaults():
121
    # arrange
122
    name = 'Simple Tuple'
123
    graph_model = graphinate.GraphModel(name=name)
124
125
    @graph_model.edge()
126
    def edge():
127
        for i in range(5):
128
            yield {'source': (i,), 'target': (i + 1,)}
129
130
    # act
131
    builder = graphinate.builders.NetworkxBuilder(graph_model)
132
    graph = builder.build()
133
134
    # assert
135
    assert isinstance(graph, nx.Graph)
136
    assert graph.graph['name'] == name
137
138
139
@pytest.mark.parametrize('execution_number', range(5))
@@ 101-117 (lines=17) @@
98
    assert graph.graph['name'] == name
99
100
101
def test_networkx_builder_simple_tuple():
102
    # arrange
103
    name = 'Simple Tuple'
104
    graph_model = graphinate.GraphModel(name=name)
105
106
    @graph_model.edge()
107
    def edge():
108
        for i in range(5):
109
            yield {'source': (i,), 'target': (i + 1,)}
110
111
    # act
112
    builder = graphinate.builders.NetworkxBuilder(graph_model)
113
    graph = builder.build()
114
115
    # assert
116
    assert isinstance(graph, nx.Graph)
117
    assert graph.graph['name'] == name
118
119
120
def test_networkx_builder__defaults():