Skip to content

Commit

Permalink
mpy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
apurvabanka committed Oct 26, 2024
1 parent 61ccea5 commit 9f9c369
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
8 changes: 4 additions & 4 deletions tests/kml_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def test_snippet(self) -> None:
assert "Snippet" not in k.to_string()

def test_address(self) -> None:
doc = kml.Document.from_string(
doc = Document.from_string(
"""
<kml:Document xmlns:kml="http://www.opengis.net/kml/2.2" id="pm-id">
<kml:name>pm-name</kml:name>
Expand All @@ -512,11 +512,11 @@ def test_address(self) -> None:
""",
)

doc2 = kml.Document.from_string(doc.to_string())
doc2 = Document.from_string(doc.to_string())
assert doc.to_string() == doc2.to_string()

def test_phone_number(self) -> None:
doc = kml.Document.from_string(
doc = Document.from_string(
"""
<kml:Document xmlns:kml="http://www.opengis.net/kml/2.2" id="pm-id">
<kml:name>pm-name</kml:name>
Expand All @@ -527,7 +527,7 @@ def test_phone_number(self) -> None:
""",
)

doc2 = kml.Document.from_string(doc.to_string())
doc2 = Document.from_string(doc.to_string())
assert doc.to_string() == doc2.to_string()

def test_groundoverlay(self) -> None:
Expand Down
15 changes: 8 additions & 7 deletions tests/styles_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"""Test the styles classes."""
import pytest

from fastkml import kml
from fastkml.containers import Document
from fastkml.features import Placemark
from fastkml import links
from fastkml import styles
from fastkml.enums import ColorMode
Expand Down Expand Up @@ -630,9 +631,9 @@ def test_create_document_style(self) -> None:
],
)

doc = kml.Document(styles=[style])
doc = Document(styles=[style])

doc2 = kml.Document()
doc2 = Document()
doc2.styles.append(style)

expected = """
Expand All @@ -648,7 +649,7 @@ def test_create_document_style(self) -> None:
</kml:Document>
"""

doc3 = kml.Document.from_string(expected)
doc3 = Document.from_string(expected)

assert doc.to_string() == doc2.to_string()
assert doc2.to_string() == doc3.to_string()
Expand All @@ -665,9 +666,9 @@ def test_create_placemark_style(self) -> None:
],
)

place = kml.Placemark(styles=[style])
place = Placemark(styles=[style])

place2 = kml.Placemark()
place2 = Placemark()
place2.styles.append(style)

expected = """
Expand All @@ -682,7 +683,7 @@ def test_create_placemark_style(self) -> None:
</kml:Placemark>
"""

place3 = kml.Placemark.from_string(expected)
place3 = Placemark.from_string(expected)
assert place.to_string() == place2.to_string()
assert place2.to_string() == place3.to_string()
assert place.to_string() == place3.to_string()
Expand Down

0 comments on commit 9f9c369

Please sign in to comment.