How to use the tzlocal.win32.reload_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 Catch-up-TV-and-More / plugin.video.catchuptvandmore / resources / lib / tzlocal / tests.py View on Github external
winreg.OpenKey.close = mock.MagicMock()
            winreg.QueryInfoKey = mock.MagicMock(return_value=(1, 1))
            winreg.EnumValue = mock.MagicMock(
                return_value=('TimeZoneKeyName', 'Belarus Standard Time'))
            winreg.EnumKey = mock.Mock(return_value='Bahia Standard Time')
            sys.modules['winreg'] = winreg
            import tzlocal.win32
            tz = tzlocal.win32.get_localzone()
            self.assertEqual(tz.zone, 'Europe/Minsk')

            tzlocal.win32.valuestodict = mock.Mock(
                return_value={
                    'StandardName': 'Mocked Standard Time',
                    'Std': 'Mocked Standard Time',
                })
            tz = tzlocal.win32.reload_localzone()
            self.assertEqual(tz.zone, 'America/Bahia')
github pymedusa / Medusa / ext / tzlocal / tests.py View on Github external
winreg.OpenKey = mock.MagicMock()
            winreg.OpenKey.close = mock.MagicMock()
            winreg.QueryInfoKey = mock.MagicMock(return_value=(1, 1))
            winreg.EnumValue = mock.MagicMock(
                return_value=('TimeZoneKeyName','Belarus Standard Time'))
            winreg.EnumKey = mock.Mock(return_value='Bahia Standard Time')
            sys.modules['winreg'] = winreg
            import tzlocal.win32
            tz = tzlocal.win32.get_localzone()
            self.assertEqual(tz.zone, 'Europe/Minsk')

            tzlocal.win32.valuestodict = mock.Mock(return_value={
                'StandardName': 'Mocked Standard Time',
                'Std': 'Mocked Standard Time',
            })
            tz = tzlocal.win32.reload_localzone()
            self.assertEqual(tz.zone, 'America/Bahia')
github Tautulli / Tautulli / lib / tzlocal / tests.py View on Github external
winreg.OpenKey = mock.MagicMock()
            winreg.OpenKey.close = mock.MagicMock()
            winreg.QueryInfoKey = mock.MagicMock(return_value=(1, 1))
            winreg.EnumValue = mock.MagicMock(
                return_value=('TimeZoneKeyName','Belarus Standard Time'))
            winreg.EnumKey = mock.Mock(return_value='Bahia Standard Time')
            sys.modules['winreg'] = winreg
            import tzlocal.win32
            tz = tzlocal.win32.get_localzone()
            self.assertEqual(tz.zone, 'Europe/Minsk')

            tzlocal.win32.valuestodict = mock.Mock(return_value={
                'StandardName': 'Mocked Standard Time',
                'Std': 'Mocked Standard Time',
            })
            tz = tzlocal.win32.reload_localzone()
            self.assertEqual(tz.zone, 'America/Bahia')
github regebro / tzlocal / tests / tests.py View on Github external
winreg.OpenKey = mock.MagicMock()
            winreg.OpenKey.close = mock.MagicMock()
            winreg.QueryInfoKey = mock.MagicMock(return_value=(1, 1))
            winreg.EnumValue = mock.MagicMock(
                return_value=('TimeZoneKeyName','Belarus Standard Time'))
            winreg.EnumKey = mock.Mock(return_value='Bahia Standard Time')
            sys.modules['winreg'] = winreg
            import tzlocal.win32
            tz = tzlocal.win32.get_localzone()
            self.assertEqual(tz.zone, 'Europe/Minsk')

            tzlocal.win32.valuestodict = mock.Mock(return_value={
                'StandardName': 'Mocked Standard Time',
                'Std': 'Mocked Standard Time',
            })
            tz = tzlocal.win32.reload_localzone()
            self.assertEqual(tz.zone, 'America/Bahia')