Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function testQuery(query, expected) {
mldb.log("testing query", query);
var resp = mldb.get('/v1/query', {q: query, format: 'table'});
mldb.log("received", resp.json);
mldb.log("expected", expected);
unittest.assertEqual(resp.responseCode, 200);
unittest.assertEqual(resp.json, expected);
}
function callAndAssert(func, expected, message)
{
var resp = mldb.get('/v1/query', {q:"SELECT " + func});
unittest.assertEqual(resp.responseCode, 200, "GET /v1/query failed");
unittest.assertEqual(resp.json[0].columns[0][1], expected, func + " " + message);
}
function testQuery(query, expected) {
mldb.log("testing query", query);
var resp = mldb.get('/v1/query', {q: query, format: 'table'});
mldb.log("received", resp.json);
mldb.log("expected", expected);
unittest.assertEqual(resp.responseCode, 200);
unittest.assertEqual(resp.json, expected);
}
function testQuery(query, expected) {
mldb.log("testing query", query);
var resp = mldb.get('/v1/query', {q: query, format: 'table'});
mldb.log("received", resp.json);
mldb.log("expected", expected);
unittest.assertEqual(resp.responseCode, 200);
unittest.assertEqual(resp.json, expected);
}
function testQuery(query, expected) {
mldb.log("testing query", query);
var resp = mldb.get('/v1/query', {q: query, format: 'table'});
mldb.log("received", resp.json);
mldb.log("expected", expected);
unittest.assertEqual(resp.responseCode, 200);
unittest.assertEqual(resp.json, expected);
}