# Path: upoints/kml.py
# KML_NS = 'http://earth.google.com/kml/2.2'
# class Placemark(trigpoints.Trigpoint):
# class Placemarks(point.KeyedPoints):
#     def __init__(
#         self, latitude, longitude, altitude=None, name=None, description=None
#     ):
#     def __str__(self):
#     def tokml(self):
#     def __init__(self, kml_file=None):
#     def import_locations(self, kml_file):
#     def export_kml_file(self):
# 
# Path: tests/utils.py
# def xml_compare(elem1, elem2, ellipsis=False):
#     """Compare XML elements
# 
#     Args:
#         ellipsis (bool): Support ellipsis for 'any' match
# 
#     Raises:
#         ValueError: On mismatch in ellipsised text
#     """
#     assert elem1.tag == elem2.tag
#     for key, value in elem1.attrib.items():
#         assert elem2.attrib.get(key) == value
#     for key in elem2.attrib.keys():
#         assert key in elem1.attrib
#     text1 = elem1.text.strip() if elem1.text else ''
#     text2 = elem2.text.strip() if elem2.text else ''
#     tail1 = elem1.tail.strip() if elem1.tail else ''
#     tail2 = elem2.tail.strip() if elem2.tail else ''
#     if ellipsis:
#         if not ellipsis_match(text1, text2):
#             raise ValueError(
#                 f'text mismatch: {elem1.text!r} != {elem2.text!r}'
#             )
#         if not ellipsis_match(tail1, tail2):
#             raise ValueError(
#                 f'tail mismatch: {elem1.tail!r} != {elem2.tail!r}'
#             )
#     else:
#         assert text1 == text2
#         assert tail1 == tail2
#     children1 = elem1.getchildren()
#     children2 = elem2.getchildren()
#     assert len(children1) == len(children2)
#     for child1, child2 in zip(children1, children2):
#         xml_compare(child1, child2, ellipsis)


from pytest import mark
from upoints.kml import Placemark, Placemarks, etree
from tests.utils import xml_compare
    @mark.parametrize(
        'args, result',
        [
            ((52, 0, 4), 'Placemark(52.0, 0.0, 4.0, None, None)'),
            ((52, 0, None), 'Placemark(52.0, 0.0, None, None, None)'),
            (
                (52, 0, None, 'name', 'desc'),
                "Placemark(52.0, 0.0, None, 'name', 'desc')",
            ),
        ],
    )
    def test___repr__(self, args, result):
        assert Placemark(*args) == result

    @mark.parametrize(
        'args, result',
        [
            ((52, 0, 4), '52°00′00″N, 000°00′00″E alt 4m'),
            ((52, 0, None), '52°00′00″N, 000°00′00″E'),
            (
                (52, 0, None, 'name', 'desc'),
                'name (52°00′00″N, 000°00′00″E) [desc]',
            ),
            (
                (52, 0, 42, 'name', 'desc'),
                'name (52°00′00″N, 000°00′00″E alt 42m) [desc]',
            ),
        ],
    )
    def test___str__(self, args, result):

# Path: upoints/kml.py
# KML_NS = 'http://earth.google.com/kml/2.2'
# class Placemark(trigpoints.Trigpoint):
# class Placemarks(point.KeyedPoints):
#     def __init__(
#         self, latitude, longitude, altitude=None, name=None, description=None
#     ):
#     def __str__(self):
#     def tokml(self):
#     def __init__(self, kml_file=None):
#     def import_locations(self, kml_file):
#     def export_kml_file(self):
# 
# Path: tests/utils.py
# def xml_compare(elem1, elem2, ellipsis=False):
#     """Compare XML elements
# 
#     Args:
#         ellipsis (bool): Support ellipsis for 'any' match
# 
#     Raises:
#         ValueError: On mismatch in ellipsised text
#     """
#     assert elem1.tag == elem2.tag
#     for key, value in elem1.attrib.items():
#         assert elem2.attrib.get(key) == value
#     for key in elem2.attrib.keys():
#         assert key in elem1.attrib
#     text1 = elem1.text.strip() if elem1.text else ''
#     text2 = elem2.text.strip() if elem2.text else ''
#     tail1 = elem1.tail.strip() if elem1.tail else ''
#     tail2 = elem2.tail.strip() if elem2.tail else ''
#     if ellipsis:
#         if not ellipsis_match(text1, text2):
#             raise ValueError(
#                 f'text mismatch: {elem1.text!r} != {elem2.text!r}'
#             )
#         if not ellipsis_match(tail1, tail2):
#             raise ValueError(
#                 f'tail mismatch: {elem1.tail!r} != {elem2.tail!r}'
#             )
#     else:
#         assert text1 == text2
#         assert tail1 == tail2
#     children1 = elem1.getchildren()
#     children2 = elem2.getchildren()
#     assert len(children1) == len(children2)
#     for child1, child2 in zip(children1, children2):
#         xml_compare(child1, child2, ellipsis)


# Path: tests/test_kml.py
from pytest import mark
from upoints.kml import Placemark, Placemarks, etree
from tests.utils import xml_compare

    @mark.parametrize(
        'args, result',
        [
            ((52, 0, 4), 'Placemark(52.0, 0.0, 4.0, None, None)'),
            ((52, 0, None), 'Placemark(52.0, 0.0, None, None, None)'),
            (
                (52, 0, None, 'name', 'desc'),
                "Placemark(52.0, 0.0, None, 'name', 'desc')",
            ),
        ],
    )
    def test___repr__(self, args, result):
        assert Placemark(*args) == result

    @mark.parametrize(
        'args, result',
        [
            ((52, 0, 4), '52°00′00″N, 000°00′00″E alt 4m'),
            ((52, 0, None), '52°00′00″N, 000°00′00″E'),
            (
                (52, 0, None, 'name', 'desc'),
                'name (52°00′00″N, 000°00′00″E) [desc]',
            ),
            (
                (52, 0, 42, 'name', 'desc'),
                'name (52°00′00″N, 000°00′00″E alt 42m) [desc]',
            ),
        ],
    )
    def test___str__(self, args, result):

        assert str(Placemark(*args)) == result