def test_it_parses_arithmetic_expressions_as_columns_with_alias(self): assert parse_sql('select 1+2 as three,that from hornswoggler;')
def test_it_parses_quoted_sql_strings_as_columns(self): assert parse_sql("select 'hello',that from hornswoggler;")
def test_select_column_names_without_spaces_parses(self): assert parse_sql('select this,that from hornswoggler;')
def test_it_parses_arithmetic_expressions_as_columns(self): assert parse_sql('select (1+2), that from hornswoggler;')
def test_space_before_semicolon_parses(self): assert parse_sql("select * from hornswoggler ;")
def test_select_float_literal_parses(self): assert parse_sql('select 1.5, that from hornswoggler;')
def test_it_parses_select_distinct(self): assert parse_sql('select distinct this, that from hornswoggler;')
def test_it_parses_case_expressions_as_columns(self): assert parse_sql( 'select case when x then y end as boop,that from hornswoggler;')
def test_missing_table_name_starting_with_underscore_raises_exception( self): with pytest.raises(ParseException): parse_sql("select * from _hornswoggler ;")
def test_missing_table_name_raises_parse_exception(self): with pytest.raises(ParseException): parse_sql("select * from ;")
def test_missing_column_name_starting_with_float_raises_exception(self): with pytest.raises(ParseException): parse_sql("select 1.7y from hornswoggler ;")
def test_missing_column_name_list_raises_parse_exception(self): with pytest.raises(ParseException): parse_sql("select from hornswoggler ;")
def test_two_selects_parses(self): assert parse_sql( "select * from hornswoggler; select * from hornswoggler ;")
def test_it_parses_comparison_expressions_as_columns(self): assert parse_sql('select 1 > 2 as boop,that from hornswoggler;')
def test_it_parses_select_all(self): assert parse_sql('select all this, that from hornswoggler;')
def test_it_parses_boolean_expressions_as_columns(self): assert parse_sql( 'select 1 > 2 AND not x as boop,that from hornswoggler;')
def test_select_number_literal_parses(self): assert parse_sql('select 1, that from hornswoggler;')
def test_it_does_not_require_a_from_clause(self): assert parse_sql('select 1;')
def test_select_star_parses(self): assert parse_sql('select * from hornswoggler;')