示例#1
0
 def test_clearing_glass_post_sunset(self):
     expected = TestWeather.expected_tint1
     sunset, sunset_epoch = create_sunset_sunrise(self.currentTime, hour=-2)
     print "sunset is {0}".format(str(sunset))
     self.weather_data = change_weather_data(self.weather_data,
                                             sunset=sunset_epoch)
     weather3.set_tint(self.weather_data)
     glass_tint = self.sense.get_pixel(1, 1)
     self.assertListEqual(
         glass_tint, expected,
         "Expected tint was tint1 ({0}) but actual tint is {1}".format(
             expected, glass_tint))
示例#2
0
 def test_current_time_between_sunsetPlusOne_and_sunriseSubOne_cloud_60(
         self):
     expected = TestWeather.expected_tint1
     sunset, sunset_epoch = create_sunset_sunrise(self.currentTime, hour=1)
     sunrise, sunrise_epoch = create_sunset_sunrise(self.currentTime,
                                                    hour=-1)
     print "sunrise is {0}".format(str(sunrise))
     print "sunset is {0}".format(str(sunset))
     self.weather_data = change_weather_data(self.weather_data,
                                             sunrise=sunrise_epoch,
                                             sunset=sunset_epoch,
                                             cloud=60)
     weather3.set_tint(self.weather_data)
     glass_tint = self.sense.get_pixel(1, 1)
     self.assertListEqual(
         glass_tint, expected,
         "Expected tint was tint1 ({0}) but actual tint is {1}".format(
             expected, glass_tint))
示例#3
0
 def test_current_time_between_sunsetPlusOne_and_sunriseSubOne_cloud_39_visibility_3001_temp_65(
         self):
     expected = TestWeather.expected_tint2
     sunset, sunset_epoch = create_sunset_sunrise(self.currentTime, hour=1)
     sunrise, sunrise_epoch = create_sunset_sunrise(self.currentTime,
                                                    hour=-1)
     print "sunrise is {0}".format(str(sunrise))
     print "sunset is {0}".format(str(sunset))
     self.weather_data = change_weather_data(self.weather_data,
                                             sunrise=sunrise_epoch,
                                             sunset=sunset_epoch,
                                             cloud=39,
                                             visibility=3001,
                                             temp=65)
     weather3.use_local_temp = False
     weather3.set_tint(self.weather_data)
     glass_tint = self.sense.get_pixel(1, 1)
     self.assertListEqual(
         glass_tint, expected,
         "Expected tint was tint2 ({0}) but actual tint is {1}".format(
             expected, glass_tint))