예제 #1
0
# Fuzz Tests for _functools

import test.fuzzhelper as fh
import _functools


def test():
    for _ in range(9999):
        fh.check(_functools,
                 valid_inputs=[
                     ((), {}),
                     ((fh.tuple, ), {}),
                     ((fh.function), {}),
                     ((fh.function, fh.list, fh.object), {}),
                     ((fh.int, fh.bool), {}),
                 ],
                 expected_exceptions=(TypeError))


if __name__ == '__main__':
    fh.do_test_loop(test)
예제 #2
0
# Fuzz Tests for _ast, _opcode

import test.fuzzhelper as fh
import _ast, _opcode

def test():
  for _ in range(9999):
    fh.check(_opcode, valid_inputs = [((fh.int,),{}), ((fh.int, fh.object),{})], expected_exceptions = (TypeError, ValueError))
    fh.check(_ast, valid_inputs = [((),{})], expected_exceptions = (TypeError, ValueError))

if __name__ == '__main__': fh.do_test_loop(test)