File: test_line_string.py

package info (click to toggle)
antimeridian 0.4.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,948 kB
  • sloc: python: 1,165; sh: 8; makefile: 4
file content (27 lines) | stat: -rw-r--r-- 805 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import pytest

import antimeridian

from .conftest import Reader


@pytest.mark.parametrize("great_circle", [True, False])
def test_line_string(
    read_input: Reader, read_output: Reader, great_circle: bool
) -> None:
    input = read_input("line")
    output = read_output("line")
    fixed = antimeridian.fix_line_string(input, great_circle)
    assert fixed.is_valid
    assert fixed.normalize() == output.normalize()


@pytest.mark.parametrize("great_circle", [True, False])
def test_multi_line_string(
    read_input: Reader, read_output: Reader, great_circle: bool
) -> None:
    input = read_input("multi-line")
    output = read_output("multi-line")
    fixed = antimeridian.fix_multi_line_string(input, great_circle)
    assert fixed.is_valid
    assert fixed.normalize() == output.normalize()