Esempio n. 1
0
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"
Esempio n. 2
0
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"
Esempio n. 3
0
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"
Esempio n. 4
0
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"
Esempio n. 5
0
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"
Esempio n. 6
0
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"
Esempio n. 7
0
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'"
Esempio n. 8
0
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'"