1 from nose.tools import eq_
3 from ..functions import none_or
7 eq_(10, none_or("10", int))
8 eq_(10.75, none_or("10.75", float))
9 eq_(None, none_or(None, int))
10 assert none_or("", str) is not None
11 assert none_or([], list) is not None
12 assert none_or({}, dict) is not None
13 assert none_or(0, int) is not None
14 assert none_or(-1, int) is not None