コード例 #1
0
 def test_image_convert_fromdropbox_missing_path(self):
     jwt_token = generate_jwt('*****@*****.**', 'dropbox-access-token')
     headers = {'authorization': f'Bearer {jwt_token}'}
     response = self.client.post('/image/convert/fromdropbox',
                                 headers=headers)
     self.assertEqual(response.status_code, 400)
     self.assertIn(b'Missing path parameter', response.data)
コード例 #2
0
 def test_image_convert_fromdropbox_invalid_access_token(self):
     jwt_token = generate_jwt('*****@*****.**', 'dropbox-access-token')
     headers = {'authorization': f'Bearer {jwt_token}'}
     payload = {'path': '/test.png', 'format': 'jpeg'}
     response = self.client.post('/image/convert/fromdropbox',
                                 headers=headers,
                                 data=payload)
     self.assertEqual(response.status_code, 401)
     self.assertIn(b'Invalid Dropbox access token', response.data)
コード例 #3
0
ファイル: base.py プロジェクト: davibpires/SheetFlask
    def setUp(self):
        app.config.from_object('config.TestConfig')
        self.client = app.test_client()

        jwt_token = generate_jwt('*****@*****.**')
        self.headers = {'authorization': f'Bearer {jwt_token}'}
コード例 #4
0
 def test_image_convert_fromdropbox_have_access_token(self):
     jwt_token = generate_jwt('*****@*****.**', 'dropbox-access-token')
     headers = {'authorization': f'Bearer {jwt_token}'}
     response = self.client.post('/image/convert/fromdropbox',
                                 headers=headers)
     self.assertNotIn(b'Missing access_token parameter', response.data)