update scripts

This commit is contained in:
Rohit Tanwar
2018-02-14 13:24:25 +05:30
parent 83e13b0b6f
commit 18ffa0ec9d
2 changed files with 8 additions and 6 deletions

View File

@ -13,10 +13,12 @@ for snippet in snippets:
test_file = open(f'test/{snippet}/{snippet}_test.py','w')
file_to_write_to.write(code)
file_to_write_to.close()
test_file.write(f'''
import pytest,types,functools
test_file.write('''
import types,functools
from tape import test
from {snippet} import {snippet}
def {snippet}_test():
assert isinstance({snippet}, (types.BuiltinFunctionType, types.FunctionType, functools.partial))
'''.strip())
def {snippet}_test(t):
t.true(isinstance({snippet}, (types.BuiltinFunctionType, types.FunctionType, functools.partial)),'{snippet} is a function')
test('Testing {snippet}',{snippet}_test)
'''.format(snippet = snippet).strip())
test_file.close()