Beispiel #1
0
 def test_name_attribute_is_working_properly(self):
     """testing if the name attribute value can be correctly changed
     """
     n = NameMixin(name='shot1')
     test_value = 'shot2'
     self.assertNotEqual(test_value, n.name)
     n.name = test_value
     self.assertEqual(test_value, n.name)
Beispiel #2
0
 def test_name_attribute_is_working_properly(self):
     """testing if the name attribute value can be correctly changed
     """
     n = NameMixin(name='shot1')
     test_value = 'shot2'
     self.assertNotEqual(test_value, n.name)
     n.name = test_value
     self.assertEqual(test_value, n.name)
Beispiel #3
0
    def test_name_attribute_is_not_a_string(self):
        """testing if a TypeError will be raised when the name attribute is set
        to a value other than a string
        """
        n = NameMixin(name='shot1')
        with self.assertRaises(TypeError) as cm:
            n.name = 123

        self.assertEqual(cm.exception.message,
                         'NameMixin.name should be a string, not int')
Beispiel #4
0
    def test_name_attribute_is_not_a_string(self):
        """testing if a TypeError will be raised when the name attribute is set
        to a value other than a string
        """
        n = NameMixin(name='shot1')
        with self.assertRaises(TypeError) as cm:
            n.name = 123

        self.assertEqual(
            cm.exception.message,
            'NameMixin.name should be a string, not int'
        )