Esempio n. 1
0
def test_init_when_unstructured():
    data = "this is an unstructured text string"
    ds = DataSource(data)
    assert isinstance(ds, UnstructuredDataSource)
    assert ds.get_data() == data
    assert not ds.structured
    assert ds.name == "string with hash 9ec30fc91f18445a44b9e9c2820d388d"
Esempio n. 2
0
def test_init_when_structured():
    data = get_sample_directory_df()
    ds = DataSource(data)
    assert isinstance(ds, StructuredDataSource)
    assert list(ds.get_data().values) == list(data.values)
    assert ds.structured
    assert ds.name == "pandas DataFrame (hash 7383002750474244645)"