Skip to content

Commit 602b1d8

Browse files
author
Austin Bingham
committed
Got coverage back to 100%.
1 parent 09d7c62 commit 602b1d8

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

tests/mapping/test_get_range.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
from yaml_where.path import Item, Key, Value
2+
from yaml_where.path import Index, Item, Key, Value
33
from yaml_where.range import Range
44
from yaml_where.yaml_where import YAMLWhereMapping
55
from yaml_where.testing.helpers import clean_yaml
@@ -79,3 +79,15 @@ def test_with_no_keys():
7979
source_map = YAMLWhere.from_string(clean_yaml(yaml))
8080
with pytest.raises(UndefinedAccessError):
8181
source_map.get_range()
82+
83+
84+
def test_with_index():
85+
yaml = """
86+
a:
87+
b: 42
88+
c:
89+
doo: hola
90+
"""
91+
source_map = YAMLWhere.from_string(clean_yaml(yaml))
92+
with pytest.raises(UndefinedAccessError):
93+
source_map.get_range(Index(0))

tests/test_path.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ def test_value_repr():
1616
def test_value_str():
1717
assert str(path.Value("value")) == "value/value"
1818

19+
def test_item_str():
20+
assert str(path.Item("value")) == "item/value"
21+
22+
1923

2024
def test_index_repr():
2125
assert repr(path.Index(0)) == "Index(value=0)"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)