def random_int_unicode_tuple(): i = integers() u = unicodes() while True: yield (i.next(), u.next())
def kv_unicode_integers(): u = unicodes() i = integers() while True: yield (u.next(), i.next())
def kv_unicode_integers(): # key-value helper u = unicodes() i = integers() while True: yield (u.next(), i.next())
__FILENAME__ = test_qc from qc import integers, floats, unicodes, characters, lists, tuples, dicts, objects, forall @forall(tries=10, i=integers()) def test_integers(i): assert type(i) == int assert i >= 0 and i <= 100 @forall(tries=10, l=lists(items=integers())) def test_a_int_list(l): assert type(l) == list @forall(tries=10, l=tuples(items=integers())) def test_a_int_tuple(l): assert type(l) == tuple @forall(tries=10, i=floats()) def test_floats(i): assert type(i) == float assert i >= 0.0 and i <= 100.0 @forall(tries=10, l=lists(items=floats())) def test_a_float_list(l): assert type(l) == list assert reduce(lambda x,y: x and type(y) == float, l, True) @forall(tries=10, ul=lists(items=unicodes())) def test_unicodes_list(ul): assert type(ul) == list if len(ul): assert type(ul[0]) == unicode
def bookcases(nshelves=integers(1, 10), book_set=lists()): while True: yield Bookcase(nshelves.next(), book_set.next())
__FILENAME__ = test_qc from qc import integers, floats, unicodes, characters, lists, tuples, dicts, objects, forall @forall(tries=10, i=integers()) def test_integers(i): assert type(i) == int assert i >= 0 and i <= 100 @forall(tries=10, l=lists(items=integers())) def test_a_int_list(l): assert type(l) == list @forall(tries=10, l=tuples(items=integers())) def test_a_int_tuple(l): assert type(l) == tuple @forall(tries=10, i=floats()) def test_floats(i): assert type(i) == float assert i >= 0.0 and i <= 100.0 @forall(tries=10, l=lists(items=floats())) def test_a_float_list(l): assert type(l) == list assert reduce(lambda x, y: x and type(y) == float, l, True)
from qc import integers, floats, unicodes, characters, lists, tuples, dicts, forall @forall(tries=10, i=integers()) def test_integers(i): assert type(i) == int assert i >= 0 and i <= 100 @forall(tries=10, l=lists(items=integers())) def test_a_int_list(l): assert type(l) == list @forall(tries=10, l=tuples(items=integers())) def test_a_int_tuple(l): assert type(l) == tuple @forall(tries=10, i=floats()) def test_floats(i): assert type(i) == float assert i >= 0.0 and i <= 100.0 @forall(tries=10, l=lists(items=floats())) def test_a_float_list(l): assert type(l) == list assert reduce(lambda x,y: x and type(y) == float, l, True) @forall(tries=10, ul=lists(items=unicodes())) def test_unicodes_list(ul): assert type(ul) == list if len(ul): assert type(ul[0]) == unicode