def test_material_set_invalid(self): """Setting an invalid material should raise an exception.""" n = Primitive() with self.assertRaises(TypeError, msg="Attempting to set material with an invalid type (a string) did not raise an exception."): n.material = "This should fail!" with self.assertRaises(TypeError, msg="Attempting to set material with an invalid type (None) did not raise an exception."): n.material = None
def test_material(self): """Setting and getting material.""" m = Material() n = Primitive() n.material = m self.assertTrue(n.material is m, "Primitive's material was not correctly set/returned.")
def test_material_set_invalid(self): """Setting an invalid material should raise an exception.""" n = Primitive() with self.assertRaises( TypeError, msg= "Attempting to set material with an invalid type (a string) did not raise an exception." ): n.material = "This should fail!" with self.assertRaises( TypeError, msg= "Attempting to set material with an invalid type (None) did not raise an exception." ): n.material = None
def test_material(self): """Setting and getting material.""" m = Material() n = Primitive() n.material = m self.assertTrue( n.material is m, "Primitive's material was not correctly set/returned.")