Skip to content

Commit

Permalink
Update test_endpoint_provider.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SamRemis committed Nov 21, 2024
1 parent 762f499 commit dec0fb9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/unit/test_endpoint_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,16 @@ def test_get_attr_can_get_dictionary_index(rule_lib):
assert result == "bar"


def test_get_attr_returns_none_on_missing_key(rule_lib):
result = rule_lib.get_attr({"foo": ['bar']}, 'baz[0]')
assert result is None


def test_get_attr_returns_none_on_too_high_index(rule_lib):
result = rule_lib.get_attr({"foo": ['bar']}, 'foo[1]')
assert result is None


def test_get_attr_can_get_list_index(rule_lib):
result = rule_lib.get_attr(("foo",), '[0]')
assert result == "foo"

0 comments on commit dec0fb9

Please sign in to comment.