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"))
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} )
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