Skip to content

Commit

Permalink
reorganize tests
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowone committed Jul 21, 2018
1 parent 4cb5918 commit 067004a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
File renamed without changes.
19 changes: 0 additions & 19 deletions tests/test_ignorable_keys.py

This file was deleted.

17 changes: 17 additions & 0 deletions tests/test_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,20 @@ def f(a, b=v):
assert f(1, 1) == (1, 1)
assert f(1, 2) == (1, 2)
assert f(1) == (1, v)


def test_basic_ignorable_key():
@ring.dict({}, ignorable_keys=['ignorable'])
def f(n, ignorable):
return n + ignorable

# the actual funtion can be different
assert f.execute(10, 5) != f.execute(10, 10)
# but key must be same
assert f.key(10, 'ignorable') == f.key(10, 'must be not considered')

# not ring-key compatible object
class A(object):
pass

assert f.key(10, A()) # ignorable key must not affect key generation

0 comments on commit 067004a

Please sign in to comment.