def test_file_writer_decorator(call, call_init_kwargs, call_kwargs, dec_kwargs, exp, tmpdir):
tmp_dec_kwargs = dict(dec_kwargs)
tmp_dec_kwargs['filename'] = os.path.join('%s' % tmpdir, dec_kwargs['filename'])
call = fuzzinator.call.FileWriterDecorator(**tmp_dec_kwargs)(call)
if inspect.isclass(call):
call = call(**call_init_kwargs)
out = call(**call_kwargs)
if out is not None:
assert re.fullmatch(pattern=dec_kwargs['filename'].format(uid='.*'), string=out['filename']) is not None
assert out['test'] == os.path.join('%s' % tmpdir, out['filename'])
assert not os.path.exists(out['test'])
del out['filename']
del out['test']
assert out == exp
test_file_writer_decorator.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录