diff --git a/tests/test_date.py b/tests/test_date.py index ce20a98b..fc318217 100644 --- a/tests/test_date.py +++ b/tests/test_date.py @@ -1,10 +1,17 @@ import os +import sys +import time import json import unittest import jc.parsers.date THIS_DIR = os.path.dirname(os.path.abspath(__file__)) +# Set the timezone on POSIX systems. Need to manually set for Windows tests +if not sys.platform.startswith('win32'): + os.environ['TZ'] = 'America/Los_Angeles' + time.tzset() + class MyTests(unittest.TestCase): diff --git a/tests/test_dig.py b/tests/test_dig.py index cca52ea8..8de41ea7 100644 --- a/tests/test_dig.py +++ b/tests/test_dig.py @@ -1,10 +1,17 @@ import os +import sys +import time import json import unittest import jc.parsers.dig THIS_DIR = os.path.dirname(os.path.abspath(__file__)) +# Set the timezone on POSIX systems. Need to manually set for Windows tests +if not sys.platform.startswith('win32'): + os.environ['TZ'] = 'America/Los_Angeles' + time.tzset() + class MyTests(unittest.TestCase): diff --git a/tests/test_dir.py b/tests/test_dir.py index fad28bcd..6fbcb62c 100644 --- a/tests/test_dir.py +++ b/tests/test_dir.py @@ -1,10 +1,17 @@ import os +import sys +import time import json import unittest import jc.parsers.dir THIS_DIR = os.path.dirname(os.path.abspath(__file__)) +# Set the timezone on POSIX systems. Need to manually set for Windows tests +if not sys.platform.startswith('win32'): + os.environ['TZ'] = 'America/Los_Angeles' + time.tzset() + class MyTests(unittest.TestCase): diff --git a/tests/test_last.py b/tests/test_last.py index e5f783d2..30b0d536 100644 --- a/tests/test_last.py +++ b/tests/test_last.py @@ -1,10 +1,17 @@ import os +import sys +import time import json import unittest import jc.parsers.last THIS_DIR = os.path.dirname(os.path.abspath(__file__)) +# Set the timezone on POSIX systems. Need to manually set for Windows tests +if not sys.platform.startswith('win32'): + os.environ['TZ'] = 'America/Los_Angeles' + time.tzset() + class MyTests(unittest.TestCase): diff --git a/tests/test_ls.py b/tests/test_ls.py index cb9c9280..13372bd5 100644 --- a/tests/test_ls.py +++ b/tests/test_ls.py @@ -1,10 +1,17 @@ import os +import sys +import time import json import unittest import jc.parsers.ls THIS_DIR = os.path.dirname(os.path.abspath(__file__)) +# Set the timezone on POSIX systems. Need to manually set for Windows tests +if not sys.platform.startswith('win32'): + os.environ['TZ'] = 'America/Los_Angeles' + time.tzset() + class MyTests(unittest.TestCase): diff --git a/tests/test_rpm_qai.py b/tests/test_rpm_qai.py index 799ca186..fa4a4463 100644 --- a/tests/test_rpm_qai.py +++ b/tests/test_rpm_qai.py @@ -1,10 +1,17 @@ import os +import sys +import time import unittest import json import jc.parsers.rpm_qi THIS_DIR = os.path.dirname(os.path.abspath(__file__)) +# Set the timezone on POSIX systems. Need to manually set for Windows tests +if not sys.platform.startswith('win32'): + os.environ['TZ'] = 'America/Los_Angeles' + time.tzset() + class MyTests(unittest.TestCase): diff --git a/tests/test_stat.py b/tests/test_stat.py index 212f9eec..9d4c84ac 100644 --- a/tests/test_stat.py +++ b/tests/test_stat.py @@ -1,10 +1,17 @@ import os +import sys +import time import json import unittest import jc.parsers.stat THIS_DIR = os.path.dirname(os.path.abspath(__file__)) +# Set the timezone on POSIX systems. Need to manually set for Windows tests +if not sys.platform.startswith('win32'): + os.environ['TZ'] = 'America/Los_Angeles' + time.tzset() + class MyTests(unittest.TestCase): diff --git a/tests/test_systeminfo.py b/tests/test_systeminfo.py index 7eccce88..64d3786a 100644 --- a/tests/test_systeminfo.py +++ b/tests/test_systeminfo.py @@ -1,10 +1,17 @@ import json import os +import sys +import time import unittest import jc.parsers.systeminfo THIS_DIR = os.path.dirname(os.path.abspath(__file__)) +# Set the timezone on POSIX systems. Need to manually set for Windows tests +if not sys.platform.startswith('win32'): + os.environ['TZ'] = 'America/Los_Angeles' + time.tzset() + class MyTests(unittest.TestCase): test_files = [ diff --git a/tests/test_upower.py b/tests/test_upower.py index a6f0b619..a4f1b295 100644 --- a/tests/test_upower.py +++ b/tests/test_upower.py @@ -1,10 +1,17 @@ import os +import sys +import time import json import unittest import jc.parsers.upower THIS_DIR = os.path.dirname(os.path.abspath(__file__)) +# Set the timezone on POSIX systems. Need to manually set for Windows tests +if not sys.platform.startswith('win32'): + os.environ['TZ'] = 'America/Los_Angeles' + time.tzset() + class MyTests(unittest.TestCase): diff --git a/tests/test_utils.py b/tests/test_utils.py index 45aa738d..883d0361 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,6 +1,14 @@ +import os +import sys +import time import unittest import jc.utils +# Set the timezone on POSIX systems. Need to manually set for Windows tests +if not sys.platform.startswith('win32'): + os.environ['TZ'] = 'America/Los_Angeles' + time.tzset() + class MyTests(unittest.TestCase): diff --git a/tests/test_who.py b/tests/test_who.py index 0366a98b..74357c5e 100644 --- a/tests/test_who.py +++ b/tests/test_who.py @@ -1,10 +1,17 @@ import os +import sys +import time import json import unittest import jc.parsers.who THIS_DIR = os.path.dirname(os.path.abspath(__file__)) +# Set the timezone on POSIX systems. Need to manually set for Windows tests +if not sys.platform.startswith('win32'): + os.environ['TZ'] = 'America/Los_Angeles' + time.tzset() + class MyTests(unittest.TestCase):