def setUp(self):
     with app.app_context():
         self.app = app.test_client()
         self.url = current_app.config["VERIFICATION_API_URL"]
         self.version = current_app.config["VERIFICATION_API_VERSION"]
         self.timeout = current_app.config["DEFAULT_TIMEOUT"]
         self.error_msg = 'Test error message'
    def setUp(self):
        self.client = app.test_client()

        with app.app_context():
            self.headers = {
                'Accept': 'application/json',
                'Content-Type': 'application/json'
            }

        try:
            app.logger.info('Setting up user...')
            with app.app_context() as ac:
                ac.g.trace_id = None
                ac.g.requests = requests.Session()
                self.user_details = service.create_new_user(self.user_data)
            self.user_details_id = self.user_data['user_details_id']
            self.ldap_id = self.user_data['ldap_id']
            self.api_key = self.user_data['api_key']

            self.agreement_id = helpers.insert_licence_agreement(
                self.user_details_id)

            app.logger.info('Done, id: {}'.format(self.user_details_id))
        except Exception:
            app.logger.error('Setup failed')
            traceback.print_exc()
            self.tearDown()
Ejemplo n.º 3
0
    def setUp(self):
        self.client = app.test_client()

        with app.app_context():
            self.headers = {
                'Accept': 'application/json',
                'Content-Type': 'application/json'
            }

        self.dataset_name = None
        self.dataset_list = []
        self.public_resources, self.resources = (False, ) * 2

        try:
            app.logger.info('Getting dataset info...')
            with app.app_context() as ac:
                ac.g.trace_id = None
                ac.g.requests = requests.Session()
                self.dataset = service.get_dataset_by_name('ccod')
            self.file_name = self.dataset['resources'][0]['file_name']
            app.logger.info('Done...')
        except Exception:
            app.logger.error('Setup failed')
            traceback.print_exc()
            self.tearDown()
    def setUp(self):
        self.client = app.test_client()

        with app.app_context():
            self.headers = {
                'Accept': 'application/json',
                'Content-Type': 'application/json'
            }
Ejemplo n.º 5
0
 def setUp(self):
     self.app = app.test_client()
     self.headers = {
         'Accept': 'application/json',
         'Content-Type': 'application/json'
     }
Ejemplo n.º 6
0
 def setUp(self):
     self.app = app.test_client()