Skip to content

Commit

Permalink
Merge pull request #21 from leaprovenzano/tests/add_a_couple_more_tes…
Browse files Browse the repository at this point in the history
…ts_for_numdict

add a couple more tests for numdict
  • Loading branch information
leaprovenzano authored Jan 1, 2021
2 parents 2cd635b + e95b72f commit 45d093d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_numdict.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,3 +644,15 @@ def test_min():
def test_max():
nd = NumDict(a=-3.56, b=3.1, c=6.4, d=2)
assert nd.max() == 6.4


def test_equality_with_scalar():
nd = NumDict(a=-3.56, b=3.1, c=6.4, d=6.4)
assert (nd == 6.4) == NumDict(a=False, b=False, c=True, d=True)


def test_missing_key_raises_attribute_error_if_accessed_from_attr():
nd = NumAttyDict(a=1, b=2)
assert nd.a == 1
with pytest.raises(AttributeError):
nd.c

0 comments on commit 45d093d

Please sign in to comment.