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
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'}