Esempio n. 1
0
def test_generative_forall():
    @qc.forall_lazy(tries=10, i=integers)
    def check_func(i):
        assert isinstance(i, int)
    for (fn, kw) in check_func():
        print 'checking %s' % fn.__name__
        assert_that(fn, is_callable)
        assert_that(kw, has_key('i'))
Esempio n. 2
0
def check_generator_in_use(i):
    assert_that(i, instance_of(int))
Esempio n. 3
0
def test_pairs(p):
    assert_that(len(p), 2)
    (l,r) = p
    assert_that(l, instance_of(int))
    assert_that(r, instance_of(str))
Esempio n. 4
0
def test_type_generation_honors_bases(t):
    assert_that(t.__bases__,    has_item(BaseX))
    assert_that(t(),            instance_of(BaseX))