def test_api(): db = SQLAlchemy() assert db.metadata == db.Model.metadata db.drop_all() db.reflect() db.rollback()
def load_post_file(filename): with open(filename, "r") as f: d = f.read() posts = "[" + d.replace("}{", "},{") + "]" posts = json.loads(posts) for p in posts: """domain --> list(len=6) --> label --> <type 'unicode'> --> final_value", "domain --> list(len=6) --> prediction --> <type 'float'> --> final_value", "leftright --> list(len=2) --> label --> <type 'unicode'> --> final_value", "leftright --> list(len=2) --> prediction --> <type 'float'> --> final_value", "manifestocode --> list(len=56) --> label --> <type 'unicode'> --> final_value", "manifestocode --> list(len=56) --> prediction --> <type 'float'> --> final_value", "numberComments --> <type 'unicode'> --> final_value", "numberLikes --> <type 'unicode'> --> final_value", "party --> <type 'unicode'> --> final_value", "postId --> <type 'unicode'> --> final_value", "text --> list(len=1) --> <type 'unicode'> --> final_value", "timeStamp --> <type 'unicode'> --> final_value"]""" db db.create_all() db.drop_all() todos = db.query(ToDo).all()