def test_simple(self): new = TypedDfs.untyped("a class", doc="A doc") assert new.__name__ == "a class" assert new.__doc__ == "A doc" df = new.convert(pd.DataFrame(sample_data())) assert isinstance(df, UntypedDf) assert df.__class__.__name__ == "a class"
def test_no_name_simple(self): with pytest.raises(TypeError): # noinspection PyTypeChecker TypedDfs.untyped(None)
def test_empty_simple(self): new = TypedDfs.untyped("a class") df = new.convert(pd.DataFrame()) assert list(df.columns) == []