def test_format_where_gt(): """greater than expressions should be formatted correctly in a where clause """ q = Query() assert q._format_where_expression(['col'], 'gt', 1.0) == "col > 1.0" assert q._format_where_expression(['col'], 'gt', 50) == "col > 50"
def test_format_where_ne(): """not equals expressions should be formatted correctly in a where clause """ q = Query() assert q._format_where_expression(['col'], 'ne', False) == "col != false" assert q._format_where_expression(['col'], 'ne', True) == "col != true"
def test_format_where_lt(): """less than expressions should be formatted correctly in a where clause """ q = Query() assert q._format_where_expression(['col'], 'lt', 1.0) == "col < 1.0" assert q._format_where_expression(['col'], 'lt', 50) == "col < 50"
def test_format_where_gt(): """greater than expressions should be formatted correctly in a where clause """ q = Query() assert q._format_where_expression(['col'], 'gt', 1.0) == "col > 1.0" assert q._format_where_expression(['col'], 'gt', 50) == "col > 50"
def test_format_where_lt(): """less than expressions should be formatted correctly in a where clause """ q = Query() assert q._format_where_expression(['col'], 'lt', 1.0) == "col < 1.0" assert q._format_where_expression(['col'], 'lt', 50) == "col < 50"
def test_format_where_ne(): """not equals expressions should be formatted correctly in a where clause """ q = Query() assert q._format_where_expression(['col'], 'ne', False) == "col != false" assert q._format_where_expression(['col'], 'ne', True) == "col != true"
def test_format_where_eq(): """equals expressions should be formatted correctly in a where clause """ q = Query() assert q._format_where_expression(['col'], 'eq', 'hi') == "col = 'hi'"
def test_format_where_eq(): """equals expressions should be formatted correctly in a where clause """ q = Query() assert q._format_where_expression(['col'], 'eq', 'hi') == "col = 'hi'"