Code Duplication    Length = 15-15 lines in 3 locations

tests/models/test_evc_base.py 3 locations

@@ 100-114 (lines=15) @@
97
            evc.update(**update_dict)
98
        self.assertEqual(str(handle_error.exception), error_message)
99
100
    def test_update_uni_z(self):
101
        """Test if raises and error when trying to update the uni_z."""
102
        attributes = {
103
            "name": "circuit_name",
104
            "uni_a": get_uni_mocked(is_valid=True),
105
            "uni_z": get_uni_mocked(is_valid=True)
106
        }
107
        update_dict = {
108
            "uni_z": get_uni_mocked(is_valid=True)
109
        }
110
        error_message = "uni_z can't be be updated."
111
        with self.assertRaises(ValueError) as handle_error:
112
            evc = EVC(**attributes)
113
            evc.update(**update_dict)
114
        self.assertEqual(str(handle_error.exception), error_message)
115
116
    def test_circuit_representation(self):
117
        """Test the method __repr__."""
@@ 84-98 (lines=15) @@
81
            evc.update(**update_dict)
82
        self.assertEqual(str(handle_error.exception), error_message)
83
84
    def test_update_uni_a(self):
85
        """Test if raises and error when trying to update the uni_a."""
86
        attributes = {
87
            "name": "circuit_name",
88
            "uni_a": get_uni_mocked(is_valid=True),
89
            "uni_z": get_uni_mocked(is_valid=True)
90
        }
91
        update_dict = {
92
            "uni_a": get_uni_mocked(is_valid=True)
93
        }
94
        error_message = "uni_a can't be be updated."
95
        with self.assertRaises(ValueError) as handle_error:
96
            evc = EVC(**attributes)
97
            evc.update(**update_dict)
98
        self.assertEqual(str(handle_error.exception), error_message)
99
100
    def test_update_uni_z(self):
101
        """Test if raises and error when trying to update the uni_z."""
@@ 68-82 (lines=15) @@
65
            EVC(**attributes)
66
        self.assertEqual(str(handle_error.exception), error_message)
67
68
    def test_update_name(self):
69
        """Test if raises and error when trying to update the name."""
70
        attributes = {
71
            "name": "circuit_name",
72
            "uni_a": get_uni_mocked(is_valid=True),
73
            "uni_z": get_uni_mocked(is_valid=True)
74
        }
75
        update_dict = {
76
            "name": "circuit_name_2"
77
        }
78
        error_message = "name can't be be updated."
79
        with self.assertRaises(ValueError) as handle_error:
80
            evc = EVC(**attributes)
81
            evc.update(**update_dict)
82
        self.assertEqual(str(handle_error.exception), error_message)
83
84
    def test_update_uni_a(self):
85
        """Test if raises and error when trying to update the uni_a."""