Skip to content
Myr

Add tests for hasattr/getattr usage on LookupDict (#7401)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Nate Prewitt · committed by GitHub · parent 27e0981 · Browse files · 1 file+13 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+13 added−0 removed

  • tests:+13 added−0 removed

1 file+13 added−0 removed

modified:tests/test_structures.py+13 added
74 unmodified lines
7576 @get_item_parameters77 def test_get(self, key, value):78 assert self.lookup_dict.get(key) == value7980 def test_hasattr(self):81 assert hasattr(self.lookup_dict, "bad_gateway") is True82 assert hasattr(self.lookup_dict, "not_a_key") is False8384 def test_getattr(self):85 assert getattr(self.lookup_dict, "bad_gateway") == 50286 with pytest.raises(AttributeError):87 getattr(self.lookup_dict, "not_a_key")8889 @get_item_parameters90 def test_getattr_default(self, key, value):91 assert getattr(self.lookup_dict, key, None) == value