示例#1
0
def test_repr_dummy():
    assert repr(Schema())
    assert repr(Table(""))
    with pytest.raises(SQLLineageException):
        Table("a.b.c")
    with pytest.warns(Warning):
        Table("a.b", Schema("c"))
示例#2
0
def helper(sql, source_tables=None, target_tables=None):
    lp = LineageRunner(sql)
    assert set(lp.source_tables) == (
        set() if source_tables is None else {Table(t) for t in source_tables}
    )
    assert set(lp.target_tables) == (
        set() if target_tables is None else {Table(t) for t in target_tables}
    )
示例#3
0
def test_hash_eq():
    assert Schema("a") == Schema("a")
    assert len({Schema("a"), Schema("a")}) == 1
    assert Table("a") == Table("a")
    assert len({Table("a"), Table("a")}) == 1