Code Duplication    Length = 15-15 lines in 3 locations

tests/test_models.py 3 locations

@@ 178-192 (lines=15) @@
175
            evc.update(**update_dict)
176
        self.assertEqual(str(handle_error.exception), error_message)
177
178
    def test_update_uni_z(self):
179
        """Test if raises and error when trying to update the uni_z."""
180
        attributes = {
181
            "name": "circuit_name",
182
            "uni_a": get_uni_mocked(is_valid=True),
183
            "uni_z": get_uni_mocked(is_valid=True)
184
        }
185
        update_dict = {
186
            "uni_z": get_uni_mocked(is_valid=True)
187
        }
188
        error_message = "uni_z can't be be updated."
189
        with self.assertRaises(ValueError) as handle_error:
190
            evc = EVC(**attributes)
191
            evc.update(**update_dict)
192
        self.assertEqual(str(handle_error.exception), error_message)
193
194
    def test_circuit_representation(self):
195
        """Test the method __repr__."""
@@ 162-176 (lines=15) @@
159
            evc.update(**update_dict)
160
        self.assertEqual(str(handle_error.exception), error_message)
161
162
    def test_update_uni_a(self):
163
        """Test if raises and error when trying to update the uni_a."""
164
        attributes = {
165
            "name": "circuit_name",
166
            "uni_a": get_uni_mocked(is_valid=True),
167
            "uni_z": get_uni_mocked(is_valid=True)
168
        }
169
        update_dict = {
170
            "uni_a": get_uni_mocked(is_valid=True)
171
        }
172
        error_message = "uni_a can't be be updated."
173
        with self.assertRaises(ValueError) as handle_error:
174
            evc = EVC(**attributes)
175
            evc.update(**update_dict)
176
        self.assertEqual(str(handle_error.exception), error_message)
177
178
    def test_update_uni_z(self):
179
        """Test if raises and error when trying to update the uni_z."""
@@ 146-160 (lines=15) @@
143
            EVC(**attributes)
144
        self.assertEqual(str(handle_error.exception), error_message)
145
146
    def test_update_name(self):
147
        """Test if raises and error when trying to update the name."""
148
        attributes = {
149
            "name": "circuit_name",
150
            "uni_a": get_uni_mocked(is_valid=True),
151
            "uni_z": get_uni_mocked(is_valid=True)
152
        }
153
        update_dict = {
154
            "name": "circuit_name_2"
155
        }
156
        error_message = "name can't be be updated."
157
        with self.assertRaises(ValueError) as handle_error:
158
            evc = EVC(**attributes)
159
            evc.update(**update_dict)
160
        self.assertEqual(str(handle_error.exception), error_message)
161
162
    def test_update_uni_a(self):
163
        """Test if raises and error when trying to update the uni_a."""