Code Duplication    Length = 16-16 lines in 3 locations

tests/models/test_evc_base.py 3 locations

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