Skip to content

Commit

Permalink
add basic test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ringsaturn committed Oct 26, 2024
1 parent 7822a63 commit 6136df1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from pytest import mark
from tzfpy import get_tz


@mark.parametrize(
"lng, lat, tz",
[
(116.3883, 39.9289, "Asia/Shanghai"),
(120.347287, 22.598127, "Asia/Taipei"),
(2.3522, 48.8566, "Europe/Paris"),
(-0.1276, 51.5074, "Europe/London"),
(13.4049, 52.5200, "Europe/Berlin"),
(-74.0060, 40.7128, "America/New_York"),
(-118.2437, 34.0522, "America/Los_Angeles"),
],
)
def test_get_tz(lng, lat, tz):
assert get_tz(lng, lat) == tz

0 comments on commit 6136df1

Please sign in to comment.