Helper function that does basic validation of line and multi-line types.
(locations: TypeMultiLine)
| 112 | |
| 113 | |
| 114 | def _validate_locations_basics(locations: TypeMultiLine) -> None: |
| 115 | """Helper function that does basic validation of line and multi-line types.""" |
| 116 | try: |
| 117 | iter(locations) |
| 118 | except TypeError: |
| 119 | raise TypeError( |
| 120 | "Locations should be an iterable with coordinate pairs," |
| 121 | f" but instead got {locations!r}." |
| 122 | ) |
| 123 | try: |
| 124 | next(iter(locations)) |
| 125 | except StopIteration: |
| 126 | raise ValueError("Locations is empty.") |
| 127 | |
| 128 | |
| 129 | def validate_locations(locations: TypeLine) -> List[List[float]]: |
no outgoing calls
no test coverage detected