Code Duplication    Length = 22-22 lines in 2 locations

tests/test_models.py 1 location

@@ 205-226 (lines=22) @@
202
        expected_value = f'EVC({evc.id}, {evc.name})'
203
        self.assertEqual(str(evc), expected_value)
204
205
    def test_comparison_method(self):
206
        """Test the method __eq__."""
207
        attributes = {
208
            "name": "circuit_name",
209
            "uni_a": get_uni_mocked(is_valid=True),
210
            "uni_z": get_uni_mocked(is_valid=True)
211
        }
212
        evc1 = EVC(**attributes)
213
        evc2 = EVC(**attributes)
214
215
        attributes = {
216
            "name": "circuit_name_2",
217
            "uni_a": get_uni_mocked(is_valid=True),
218
            "uni_z": get_uni_mocked(is_valid=True)
219
        }
220
        evc3 = EVC(**attributes)
221
        evc4 = EVC(**attributes)
222
223
        self.assertEqual(evc1 == evc2, True)
224
        self.assertEqual(evc1 == evc3, False)
225
        self.assertEqual(evc2 == evc3, False)
226
        self.assertEqual(evc3 == evc4, True)
227
228
    def test_as_dict(self):
229
        """Test the method as_dict."""

tests/models/test_evc_base.py 1 location

@@ 127-148 (lines=22) @@
124
        expected_value = f'EVC({evc.id}, {evc.name})'
125
        self.assertEqual(str(evc), expected_value)
126
127
    def test_comparison_method(self):
128
        """Test the method __eq__."""
129
        attributes = {
130
            "name": "circuit_name",
131
            "uni_a": get_uni_mocked(is_valid=True),
132
            "uni_z": get_uni_mocked(is_valid=True)
133
        }
134
        evc1 = EVC(**attributes)
135
        evc2 = EVC(**attributes)
136
137
        attributes = {
138
            "name": "circuit_name_2",
139
            "uni_a": get_uni_mocked(is_valid=True),
140
            "uni_z": get_uni_mocked(is_valid=True)
141
        }
142
        evc3 = EVC(**attributes)
143
        evc4 = EVC(**attributes)
144
145
        self.assertEqual(evc1 == evc2, True)
146
        self.assertEqual(evc1 == evc3, False)
147
        self.assertEqual(evc2 == evc3, False)
148
        self.assertEqual(evc3 == evc4, True)
149
150
    def test_as_dict(self):
151
        """Test the method as_dict."""