Raise an error if Path._directions is not set ...
... instead of failing inside `json.loads()` on `None`
This commit is contained in:
parent
744d9a6353
commit
607055d55a
1 changed files with 10 additions and 0 deletions
|
|
@ -670,6 +670,13 @@ class TestSyncWithGoogleMaps:
|
|||
class TestProperties:
|
||||
"""Test properties in `Path`."""
|
||||
|
||||
def test_waypoints_no_directions(self, path):
|
||||
"""Test `Path.waypoints` property."""
|
||||
path._directions = None
|
||||
|
||||
with pytest.raises(RuntimeError, match="not set"):
|
||||
int(path.waypoints)
|
||||
|
||||
def test_waypoints_structure(self, path):
|
||||
"""Test `Path.waypoints` property."""
|
||||
result = path.waypoints
|
||||
|
|
|
|||
Loading…
Reference in a new issue