Beispiel #1
0
def test_sql_solid_without_table_name():
    with pytest.raises(Exception) as excinfo:
        sql_solid('foo', 'select * from bar', 'table')
    assert (
        str(excinfo.value) == 'Missing table_name: required for materialization strategy \'table\''
    )
Beispiel #2
0
def test_sql_solid():
    result = sql_solid('foo', 'select * from bar', 'table', 'quux')
    assert result
Beispiel #3
0
def test_sql_solid_with_bad_materialization_strategy():
    with pytest.raises(Exception) as excinfo:
        sql_solid('foo', 'select * from bar', 'view')
    assert str(excinfo.value) == 'Invalid materialization strategy view, must be one of [\'table\']'
Beispiel #4
0
def test_sql_solid():
    result = sql_solid("foo", "select * from bar", "table", "quux")
    assert result
Beispiel #5
0
def test_sql_solid_without_table_name():
    with pytest.raises(Exception) as excinfo:
        sql_solid("foo", "select * from bar", "table")
    assert str(excinfo.value) == "Missing table_name: required for materialization strategy 'table'"
Beispiel #6
0
def test_sql_solid_with_bad_materialization_strategy():
    with pytest.raises(Exception) as excinfo:
        sql_solid("foo", "select * from bar", "view")
    assert str(excinfo.value) == "Invalid materialization strategy view, must be one of ['table']"
Beispiel #7
0
def test_sql_solid():
    solid = sql_solid("foo", "select * from bar", "table", "quux")
    assert solid