summaryrefslogtreecommitdiffstats
path: root/tests/tz/test_local_timezone.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-01-30 07:57:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-01-30 07:57:29 +0000
commita003430ded2dbfbfb48acd3c17f143cbafeee60a (patch)
tree9016b0b904b32c46542f48de704b3e536b90e1af /tests/tz/test_local_timezone.py
parentInitial commit. (diff)
downloadpendulum-a003430ded2dbfbfb48acd3c17f143cbafeee60a.tar.xz
pendulum-a003430ded2dbfbfb48acd3c17f143cbafeee60a.zip
Adding upstream version 2.1.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/tz/test_local_timezone.py')
-rw-r--r--tests/tz/test_local_timezone.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/tz/test_local_timezone.py b/tests/tz/test_local_timezone.py
new file mode 100644
index 0000000..fdf1cc2
--- /dev/null
+++ b/tests/tz/test_local_timezone.py
@@ -0,0 +1,38 @@
+import os
+import sys
+
+import pytest
+
+from pendulum.tz.local_timezone import _get_unix_timezone
+from pendulum.tz.local_timezone import _get_windows_timezone
+
+
+@pytest.mark.skipif(
+ sys.platform == "win32", reason="Test only available for UNIX systems"
+)
+def test_unix_symlink():
+ # A ZONE setting in the target path of a symbolic linked localtime,
+ # f ex systemd distributions
+ local_path = os.path.join(os.path.split(__file__)[0], "..")
+ tz = _get_unix_timezone(_root=os.path.join(local_path, "fixtures", "tz", "symlink"))
+
+ assert tz.name == "Europe/Paris"
+
+
+@pytest.mark.skipif(
+ sys.platform == "win32", reason="Test only available for UNIX systems"
+)
+def test_unix_clock():
+ # A ZONE setting in the target path of a symbolic linked localtime,
+ # f ex systemd distributions
+ local_path = os.path.join(os.path.split(__file__)[0], "..")
+ tz = _get_unix_timezone(_root=os.path.join(local_path, "fixtures", "tz", "clock"))
+
+ assert tz.name == "Europe/Zurich"
+
+
+@pytest.mark.skipif(sys.platform != "win32", reason="Test only available for Windows")
+def test_windows_timezone():
+ timezone = _get_windows_timezone()
+
+ assert timezone is not None