Skip to content

Commit

Permalink
No need to run KmlDateTime Test with lxml
Browse files Browse the repository at this point in the history
  • Loading branch information
cleder committed Jan 13, 2023
1 parent d98a85d commit 5e937c5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/times_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 Christian Ledermann
# Copyright (C) 2022 - 2023 Christian Ledermann
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
Expand Down Expand Up @@ -28,17 +28,17 @@
from tests.base import StdLibrary


class TestStdLibrary(StdLibrary):
"""Test with the standard library."""
class TestDateTime:
"""KmlDateTime implementation is independent of XML parser."""

def test_kml_datetime_year(self):
dt = datetime.datetime(2000, 1, 1, tzinfo=tzutc())
dt = datetime.datetime(2000, 1, 1)
kdt = KmlDateTime(dt, DateTimeResolution.year)
assert kdt.resolution == DateTimeResolution.year
assert str(kdt) == "2000"

def test_kml_datetime_year_month(self):
dt = datetime.datetime(2000, 3, 1, tzinfo=tzutc())
dt = datetime.datetime(2000, 3, 1)
kdt = KmlDateTime(dt, DateTimeResolution.year_month)
assert kdt.resolution == DateTimeResolution.year_month
assert str(kdt) == "2000-03"
Expand Down Expand Up @@ -67,6 +67,10 @@ def test_kml_datetime_datetime_implicit(self):
assert kdt.resolution == DateTimeResolution.datetime
assert str(kdt) == dt.isoformat()


class TestStdLibrary(StdLibrary):
"""Test with the standard library."""

def test_timestamp(self):
now = datetime.datetime.now()
ts = kml.TimeStamp(timestamp=now)
Expand Down

0 comments on commit 5e937c5

Please sign in to comment.