def test_util_get_sunset_time_raise_error(self): with self.assertRaises(NoTimeZoneInfoError): util.get_sunset_time(self.lat, self.lon, self.unaware)
def test_util_get_sunset_time_no_error(self): try: util.get_sunset_time(self.lat, self.lon, self.aware) except NoTimeZoneInfoError: self.fail("""'NoTimeZoneInfoError' should not be raised \ as 'datetime' object is tz-aware.""")