コード例 #1
0
    def setUp(self):
        self.app = create_app(TestingConfig)
        self.client = self.app.test_client()
        db = Dbcontroller()
        db.create_tables()

        self.user = {
            "usrid": "1",
            "username": "******",
            "email": "*****@*****.**",
            "password": "******"
        }
        self.question = {
            "qnId": "1",
            "question": "What is an exception?",
            "usrid": "3"
        }
        self.answer = {
            "ansid": "1",
            "answer": "Set of rules",
            "qnid": "1",
            "usrid": "1",
            "authid": "2",
            "comment": "accepted"
        }
        self.signup = {
            "username": "******",
            "email": "*****@*****.**",
            "password": "******"
        }
        self.login = {
            "username": "******",
            "password": "******"
        }

        self.question_add = {
            "question": "What is c++?"
        }
        self.another_question = {
            "question": "What is python?"
        }
        self.answer_post = {
            "answer": "pythonic language"
        }
        self.answer_post_empty = {
            "answer": ""
        }
コード例 #2
0
from api import create_app
from config import DevelopmentConfig
from dbcontroller import Dbcontroller

app = create_app(DevelopmentConfig)

if __name__ == '__main__':
    database_connection = Dbcontroller()
    database_connection.create_tables()
    app.run()