Esempio n. 1
0
 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"
Esempio n. 2
0
 def test_no_name_simple(self):
     with pytest.raises(TypeError):
         # noinspection PyTypeChecker
         TypedDfs.untyped(None)
Esempio n. 3
0
 def test_empty_simple(self):
     new = TypedDfs.untyped("a class")
     df = new.convert(pd.DataFrame())
     assert list(df.columns) == []