Ejemplo n.º 1
0
 def test_can_set_from_simple_settings(self):
     raspi = RasPi(self.mockconfig)
     settings = LightSettings(red=10, green=20, blue=30)
     raspi.apply_settings(settings)
     red, green, blue = raspi.get_current_dutycycles()
     self.assertEquals(10, red)
     self.assertEquals(20, green)
     self.assertEquals(30, blue)
Ejemplo n.º 2
0
 def test_can_get_all_dutycyles(self):
     raspi = RasPi(self.mockconfig)
     a = 10
     for led in raspi.leds:
         raspi.set_PWM_dutycycle(led, a)
         a += 10
     red, green, blue = raspi.get_current_dutycycles()
     self.assertEquals(10, red)
     self.assertEquals(20, green)
     self.assertEquals(30, blue)