Skip to content

Commit

Permalink
refactor move tests from old_unittests to kml_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cleder committed Apr 19, 2024
1 parent 0fc438e commit 7b7e268
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 11 additions & 0 deletions tests/kml_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ def test_linarring_placemark(self) -> None:
assert isinstance(doc.features[0].geometry, geo.LinearRing)
assert doc.to_string() == doc2.to_string()

def test_kml(self) -> None:
"""Kml file without contents."""
k = kml.KML(ns="")
assert k.features == []
assert (
k.to_string().strip().replace(" ", "")
== '<kmlxmlns="http://www.opengis.net/kml/2.2"/>'
)
k2 = kml.KML.class_from_string(k.to_string(), ns="")
assert k.to_string() == k2.to_string()


class TestLxml(Lxml, TestStdLibrary):
"""Test with lxml."""
Expand Down
11 changes: 0 additions & 11 deletions tests/oldunit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,6 @@ def setup_method(self) -> None:
config.set_etree_implementation(xml.etree.ElementTree)
config.set_default_namespaces()

def test_kml(self) -> None:
"""Kml file without contents."""
k = kml.KML(ns="")
assert k.features == []
assert (
str(k.to_string())[:51]
== '<kml xmlns="http://www.opengis.net/kml/2.2" />'[:51]
)
k2 = kml.KML.class_from_string(k.to_string(), ns="")
assert k.to_string() == k2.to_string()

def test_folder(self) -> None:
"""KML file with folders."""
ns = "{http://www.opengis.net/kml/2.2}"
Expand Down

0 comments on commit 7b7e268

Please sign in to comment.