def test_lighting_with_pattern(self):
     m = Material()
     m.pattern = Stripe(Color(1, 1, 1), Color(0, 0, 0))
     m.ambient = 1
     m.diffuse = 0
     m.specular = 0
     eyev = Vector(0, 0, -1)
     normalv = Vector(0, 0, -1)
     light = PointLight(Point(0, 0, -10), Color(1, 1, 1))
     c1 = PointLight.lighting(m, Sphere(), light, Point(0.9, 0, 0), eyev, normalv, False)
     c2 = PointLight.lighting(m, Sphere(), light, Point(1.1, 0, 0), eyev, normalv, False)
     self.assertEqual(c1, Color(1, 1, 1))
     self.assertEqual(c2, Color(0, 0, 0))
 def test_lighting_with_a_pattern_applied(self):
     sp = StripePattern(Color(1, 1, 1), Color(0, 0, 0))
     m = Material()
     m.pattern = sp
     m.ambient = 1
     m.diffuse = 0
     m.specular = 0
     eyev = Vector(0, 0, -1)
     normalv = Vector(0, 0, -1)
     light = Light(Point(0, 0, -10), Color(1, 1, 1))
     c1 = m.lighting(Sphere(), light, Point(0.9, 0, 0), eyev, normalv,
                     False)
     c2 = m.lighting(Sphere(), light, Point(1.1, 0, 0), eyev, normalv,
                     False)
     self.assertTrue(c1.equals(Color(1, 1, 1)))
     self.assertTrue(c2.equals(Color(0, 0, 0)))