Code Duplication    Length = 24-24 lines in 2 locations

tests/graphinate/renderers/test_matplotlib_plot.py 2 locations

@@ 235-258 (lines=24) @@
232
        mock_pyplot.show.assert_called_once()
233
234
    # Plot a graph with custom edge attributes that aren't 'label'
235
    def test_plot_with_custom_edge_attributes(self, mocker):
236
        # Arrange
237
        mock_draw = mocker.patch('graphinate.renderers.matplotlib.draw')
238
        mock_pyplot = mocker.patch('graphinate.renderers.matplotlib.pyplot')
239
        mock_ax = mocker.MagicMock()
240
        mock_fig = mocker.MagicMock()
241
        mock_pyplot.gca.return_value = mock_ax
242
        mock_pyplot.gcf.return_value = mock_fig
243
244
        graph = nx.Graph(name="Graph with Custom Edge Attributes")
245
        graph.add_node(1, label="Node 1")
246
        graph.add_node(2, label="Node 2")
247
        graph.add_edge(1, 2, label="Edge 1-2", weight=5, type="connection")
248
249
        # Act
250
        from graphinate.renderers.matplotlib import plot
251
        plot(graph, with_edge_labels=True)
252
253
        # Assert
254
        mock_draw.assert_called_once_with(graph, True, True)
255
        mock_ax.margins.assert_called_once_with(0.10)
256
        mock_fig.suptitle.assert_called_once_with("Graph with Custom Edge Attributes")
257
        mock_fig.tight_layout.assert_called_once()
258
        mock_pyplot.show.assert_called_once()
259
@@ 209-232 (lines=24) @@
206
        mock_pyplot.show.assert_called_once()
207
208
    # Plot a graph with custom node attributes that aren't 'label'
209
    def test_plot_with_custom_node_attributes(self, mocker):
210
        # Arrange
211
        mock_draw = mocker.patch('graphinate.renderers.matplotlib.draw')
212
        mock_pyplot = mocker.patch('graphinate.renderers.matplotlib.pyplot')
213
        mock_ax = mocker.MagicMock()
214
        mock_fig = mocker.MagicMock()
215
        mock_pyplot.gca.return_value = mock_ax
216
        mock_pyplot.gcf.return_value = mock_fig
217
218
        graph = nx.Graph(name="Graph with Custom Node Attributes")
219
        graph.add_node(1, label="Node 1", weight=10, category="A")
220
        graph.add_node(2, label="Node 2", weight=5, category="B")
221
        graph.add_edge(1, 2)
222
223
        # Act
224
        from graphinate.renderers.matplotlib import plot
225
        plot(graph)
226
227
        # Assert
228
        mock_draw.assert_called_once_with(graph, True, False)
229
        mock_ax.margins.assert_called_once_with(0.10)
230
        mock_fig.suptitle.assert_called_once_with("Graph with Custom Node Attributes")
231
        mock_fig.tight_layout.assert_called_once()
232
        mock_pyplot.show.assert_called_once()
233
234
    # Plot a graph with custom edge attributes that aren't 'label'
235
    def test_plot_with_custom_edge_attributes(self, mocker):