コード例 #1
0
    def tearDownClass(cls):
        if cls.client:
            # stop the flask server and the browser
            cls.client.get('http://localhost:4000/shutdown')
            cls.client.close()

            # destroy database
            db.drop_all()
            db.session.remove()

            # remove application context
            cls.app_context.pop()
コード例 #2
0
    def tearDownClass(cls):
        if cls.client:
            # stop the flask server and the browser
            cls.client.get('http://localhost:4000/shutdown')
            cls.client.close()

            # destroy database
            db.drop_all()
            db.session.remove()

            # remove application context
            cls.app_context.pop()
コード例 #3
0
    def setUp(self):
        self.app = create_app('TESTING_CONFIG')
        self.app_context = self.app.app_context()
        self.app_context.push()
        db.drop_all()
        db.create_all()
        test_password = '******'
        Organization.insert_org()
        UserScope.insert_scopes()
        User.insert_user(password=test_password)

        self.client = self.app.test_client(use_cookies=False)
        self.basedir = os.path.abspath(os.path.dirname(__file__))
        with open(self.basedir + '/mock_data/asset_post.json', 'r') as f:
            doc = json.load(f)
        self.asset_json_in = doc

        with open(self.basedir + '/mock_results/asset_from.json', 'r') as f:
            doc = json.load(f)
        self.asset_from_json = doc
コード例 #4
0
    def setUp(self):
        self.app = create_app('TESTING_CONFIG')
        self.app_context = self.app.app_context()
        self.app_context.push()
        db.drop_all()
        db.create_all()
        test_password = '******'
        Organization.insert_org()
        UserScope.insert_scopes()
        User.insert_user(password=test_password)

        self.client = self.app.test_client(use_cookies=False)
        self.basedir = os.path.abspath(os.path.dirname(__file__))
        with open(self.basedir + '/mock_data/asset_post.json', 'r') as f:
            doc = json.load(f)
        self.asset_json_in = doc

        with open(self.basedir + '/mock_results/asset_from.json', 'r') as f:
            doc = json.load(f)
        self.asset_from_json = doc
コード例 #5
0
 def tearDown(self):
     db.session.remove()
     db.drop_all()
     self.app_context.pop()
コード例 #6
0
 def tearDown(self):
     db.session.remove()
     db.drop_all()
     self.app_context.pop()