示例#1
0
def checkQuery(testcase, name):
 # Run the query
 script = name + '.todo.sql'
 actual = runSQLScript(dbName, script)
 # Compare to correct 
 csv = os.path.join(correctDir, name + '.csv')
 with open(csv, 'r') as f:
   expected =f.read().strip()
   testcase.assertEqual(actual, expected, 'Query "%s" produced incorrect output' % name)
示例#2
0
def checkQuery(testcase, name):
    # Run the query
    script = name + '.todo.sql'
    actual = runSQLScript(dbName, script)
    # Compare to correct
    csv = os.path.join(correctDir, name + '.csv')
    with open(csv, 'r') as f:
        expected = f.read().strip()
        testcase.assertEqual(actual, expected,
                             'Query "%s" produced incorrect output' % name)
示例#3
0
def setupDb():
    runCommand('rm -f %s' % dbName)
    runSQLScript(dbName, 'schema.sql')
    runSQLScript(dbName, 'import.sql')
示例#4
0
def setupDb():
  runCommand('rm -f %s' % dbName)
  runSQLScript(dbName, 'schema.sql')
  runSQLScript(dbName, 'import.sql')