Ejemplo n.º 1
0
def test_put_schema(tmpdir):
    schema_path = os.path.join(tmpdir, ".schema")
    test_schema = {'name': 'str', 'age': 'int', 'employed': 'bool'}
    dbm = DbManager(tmpdir)
    dbm._put_schema(schema_path, test_schema)

    inserted_schema = dbm._get_schema(schema_path)
    assert inserted_schema == test_schema
Ejemplo n.º 2
0
def test_get_schema(tmpdir):
    schema_path = os.path.join(tmpdir, ".schema")
    with open(schema_path, "w") as fd:
        fd.write("""name,str
age,int
employed,bool
""")
    dbm = DbManager(tmpdir)
    schema = dbm._get_schema(schema_path)
    assert schema == {'name': 'str', 'age': 'int', 'employed': 'bool'}