'Verify that L{getTimezoneOffset} produces the expected offset for a
certain timezone both when daylight saving time is in effect and when
it is not.
@param tzname: The name of a timezone to exercise.
@type tzname: L{bytes}
@param daylightOffset: The number of seconds west of UTC the timezone
should be when daylight saving time is in effect.
@type daylightOffset: L{int}
@param standardOffset: The number of seconds west of UTC the timezone
should be when daylight saving time is not in effect.
@type standardOffset: L{int}'

def _getTimezoneOffsetTest(self, tzname, daylightOffset, standardOffset):

    if (getattr(time, 'tzset', None) is None):
        raise unittest.SkipTest('Platform    cannot    change    timezone,    cannot    verify    correct    offsets    in    well-known    timezones.')
    originalTimezone = os.environ.get('TZ', None)
    try:
        os.environ['TZ'] = tzname
        time.tzset()
        localDaylightTuple = (2006, 6, 30, 0, 0, 0, 4, 181, 1)
        daylight = time.mktime(localDaylightTuple)
        localStandardTuple = (2007, 1, 31, 0, 0, 0, 2, 31, 0)
        standard = time.mktime(localStandardTuple)
        self.assertEqual((self.flo.getTimezoneOffset(daylight), self.flo.getTimezoneOffset(standard)), (daylightOffset, standardOffset))
    finally:
        if (originalTimezone is None):
            del os.environ['TZ']
        else:
            os.environ['TZ'] = originalTimezone
        time.tzset()
