import pandokia.helpers.minipyt as minipyt minipyt.noseguard() import pprint @minipyt.test def t100_explain_runs_no_dict(): x = dbx.explain_query("select * from test_table", {}) print(x)
import os.path import json import time import pandokia.helpers.minipyt as mph import pandokia.helpers.pycode as pycode # software under test: import pandokia.helpers.filecomp as filecomp # mph.noseguard() @mph.test def filecomp_t(): global tda tda = {} # list of files to compare files = [ ("test_1.txt", "diff") ] # delete output files before running test filecomp.delete_output_files(files) # some data l = [{'a': 1, 'b': 2}, [1, 2]]
import pandokia.helpers.minipyt as minipyt minipyt.noseguard() dbx = None # will be assigned after we are imported import io csv_of_table = '''a,b,c a,b,1 a,c,2 aaa,bbb,111 ''' @minipyt.test def t020_csv(): out = io.StringIO() dbx.table_to_csv('test_table', out) s = out.getvalue().replace('\r', '') if s != csv_of_table: import difflib for x in difflib.context_diff(s.split('\n'), csv_of_table.split('\n')): print(x) assert 0, 'Not match'