Exemple #1
0
 def get_token():
     file = abspath(join(__file__, "../../tests/pangu/test.json"))
     load_local_data(data_file=file)
     login_client = pangu_login(base_url=services.pangu)
     login_resp = login_client.get_token(D.userpangu.username, D.userpangu.password, D.userpangu.key)
     token = login_resp.data.token
     return token
Exemple #2
0
 def setUpClass(cls) -> None:
     login_client = Login(base_url=services.mega)
     print(services.mega)
     if "dev" in services.mega:
         file = abspath(join(__file__, "../../test.json"))
         load_local_data(data_file=file)
         resp = login_client.get_token(username=D.user_mega.username,
                                       password=D.user_mega.password)
     else:
         resp = login_client.get_token(username="******",
                                       password="******")
     cls.token = resp.data.session_id
     cls.client = CompanyClient(base_url=services.mega,
                                access_token=cls.token)
Exemple #3
0
# -*- coding: utf-8 -*-

import unittest, warnings
from apis.mega.freesubscriber.freesubscriber import FreesubscriberClient
from apis.mega.login.login import Login
from config import services
from data import DataCenter as D, load_local_data
from os.path import join, abspath
from qav5 import log

file = abspath(join(__file__, "../../test.json"))
load_local_data(data_file=file)


class BaseTestCase(unittest.TestCase):
    @classmethod
    def setUpClass(cls) -> None:
        login_client = Login(base_url=services.mega)
        resp = login_client.get_token(username=D.user_mega.username,
                                      password=D.user_mega.password)
        cls.token = resp.data.session_id
        cls.client = FreesubscriberClient(base_url=services.mega,
                                          access_token=cls.token)

    def setUp(self) -> None:
        pass

    def tearDown(self) -> None:
        pass