def test_clone(s, t, c, v, e): dataset1 = DataSet(s) dataset1.add_table(t, [c]) dataset1.tables[t].columns[c].add_value(v, e) schema1 = dataset1.get_schema() dataset2 = dataset1.clone() schema2 = dataset2.get_schema() assert schema1 == schema2
def test_get_shema(s, t, c, v): dataset = DataSet(s) dataset.add_table(t, [c]) dataset.tables[t].columns[c].add_value(v) schema = dataset.get_schema() assert t in schema and schema[t] and c in schema[t] and schema[t][c][ "id"] == c and "count" in schema[t][c] and schema[t][c]["count"] == 1
def test_get_schema(s, t, c, v, e): dataset = DataSet(s) dataset.add_table(t, [c]) dataset.tables[t].columns[c].add_value(v, e) schema = dataset.get_schema() assert t in schema assert schema[t] assert c in schema[t] assert schema[t][c]["id"] == c assert "count" in schema[t][c] assert schema[t][c]["count"] == 1
def test_join(s, t, c, v0, e0, v1, e1): dataset1 = DataSet(s) dataset1.add_table(t, [c]) dataset1.tables[t].columns[c].add_value(v0, e0) dataset2 = DataSet(s) dataset2.add_table(t, [c]) dataset2.tables[t].columns[c].add_value(v1, e0) dataset1 = dataset1.join(dataset2) schema = dataset1.get_schema() assert t in schema assert schema[t] assert c in schema[t] assert "count" in schema[t][c] assert schema[t][c]["count"] == 2