Ejemplo n.º 1
0
    def setUp(self):
        # 登录 获取token
        token_info = login_1(self.session)
        self.token = token_info['token_type'] + ' ' + token_info['token']
        self.headers['Authorization'] = self.token

        log.info(f'{self.headers}')
 def setUp(self):
     # 初始化session
     self.session = HttpSessionHandler()
     # 登录账号,获取token_info
     token_info = login_1(self.session)
     token = token_info['token_type'] + ' ' + token_info['token']
     # 完善请求头
     self.headers['Authorization'] = token
     log.info(self.headers)
Ejemplo n.º 3
0
    def setUpClass(cls):
        cls.session = HttpSessionHandler()
        cls.url = config.get('api', 'base_url') + config.get('api', 'loans_url')
        cls.headers = eval(config.get('api', 'headers'))
        cls.headers.pop('Content-Type')

        token_info = login_1(cls.session)
        cls.headers['Authorization'] = token_info['token_type'] + ' ' + token_info['token']

        log.info(f'{cls.url}')
Ejemplo n.º 4
0
 def setUp(self):
     token_info = login_1(session=self.session)
     token = token_info['token_type'] + ' ' + token_info['token']
     self.headers['Authorization'] = token
Ejemplo n.º 5
0
 def setUp(self):
     self.session = HttpSessionHandler()
     # 登录并放回token_info
     token_info = login_1(self.session)
     self.headers['Authorization'] = token_info['token_type'] + " " + token_info['token']
Ejemplo n.º 6
0
 def setUp(self):
     # 登录 获取token
     token_info = login_1(self.session)
     token = token_info['token_type'] + " " + token_info['token']
     self.headers['Authorization'] = token