How to use the tzlocal.unix.get_localzone function in tzlocal

To help you get started, we’ve selected a few tzlocal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pymedusa / Medusa / ext / tzlocal / tests.py View on Github external
def test_get_reload(self):
        os.environ['TZ'] = 'Africa/Harare'
        tz_harare = tzlocal.unix.get_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Harare')
        # Changing the TZ makes no difference, because it's cached
        os.environ['TZ'] = 'Africa/Johannesburg'
        tz_harare = tzlocal.unix.get_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Harare')
        # So we reload it
        tz_harare = tzlocal.unix.reload_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Johannesburg')
github Tautulli / Tautulli / lib / tzlocal / tests.py View on Github external
def test_get_reload(self):
        os.environ['TZ'] = 'Africa/Harare'
        tz_harare = tzlocal.unix.get_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Harare')
        # Changing the TZ makes no difference, because it's cached
        os.environ['TZ'] = 'Africa/Johannesburg'
        tz_harare = tzlocal.unix.get_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Harare')
        # So we reload it
        tz_harare = tzlocal.unix.reload_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Johannesburg')
github Catch-up-TV-and-More / plugin.video.catchuptvandmore / resources / lib / tzlocal / tests.py View on Github external
def test_get_reload(self):
        os.environ['TZ'] = 'Africa/Harare'
        tz_harare = tzlocal.unix.get_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Harare')
        # Changing the TZ makes no difference, because it's cached
        os.environ['TZ'] = 'Africa/Johannesburg'
        tz_harare = tzlocal.unix.get_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Harare')
        # So we reload it
        tz_harare = tzlocal.unix.reload_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Johannesburg')
github regebro / tzlocal / tests / tests.py View on Github external
def test_get_reload(self, atomock):
        # Clear any cached zone
        tzlocal.unix._cache_tz = None
        os.environ['TZ'] = 'Africa/Harare'
        tz_harare = tzlocal.unix.get_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Harare')
        # Changing the TZ makes no difference, because it's cached
        os.environ['TZ'] = 'Africa/Johannesburg'
        tz_harare = tzlocal.unix.get_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Harare')
        # So we reload it
        tz_harare = tzlocal.unix.reload_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Johannesburg')
github Catch-up-TV-and-More / plugin.video.catchuptvandmore / resources / lib / tzlocal / tests.py View on Github external
def test_get_reload(self):
        os.environ['TZ'] = 'Africa/Harare'
        tz_harare = tzlocal.unix.get_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Harare')
        # Changing the TZ makes no difference, because it's cached
        os.environ['TZ'] = 'Africa/Johannesburg'
        tz_harare = tzlocal.unix.get_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Harare')
        # So we reload it
        tz_harare = tzlocal.unix.reload_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Johannesburg')
github Tautulli / Tautulli / lib / tzlocal / tests.py View on Github external
def test_get_reload(self):
        os.environ['TZ'] = 'Africa/Harare'
        tz_harare = tzlocal.unix.get_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Harare')
        # Changing the TZ makes no difference, because it's cached
        os.environ['TZ'] = 'Africa/Johannesburg'
        tz_harare = tzlocal.unix.get_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Harare')
        # So we reload it
        tz_harare = tzlocal.unix.reload_localzone()
        self.assertEqual(tz_harare.zone, 'Africa/Johannesburg')