示例#1
0
 def setUp(self):
     self.events = Event(
         PropertyMock(url='test_url',
                      team='test_team',
                      signature='test_signature',
                      token='old_value',
                      verify=True,
                      r=Mock(return_value=(200, {
                          'token': '123'
                      }))))
示例#2
0
 def setUp(self):
     self.events = Event(
         PropertyMock(url='test_url',
                      team='test_team',
                      signature='test_signature',
                      token='old_value',
                      verify=True,
                      r=Mock(return_value=(200, {
                          'token': '123'
                      }))))
     self.id = 'test_id'
     self.comment = "test_comment"
     self.status = "Challenge"
示例#3
0
    def __init__(self, **settings):
        self.log = logging.getLogger(__name__)
        self.log.debug('Client has been init with %s', settings)

        assert 'url' in settings, 'url is required parameter'
        assert isinstance(settings['url'], str), 'url value must be a string'
        assert 'team' in settings, 'team is required parameter'
        assert isinstance(settings['team'], str), 'team value must be a string'

        self.url = str(settings['url'])
        self.af_url = str(
            settings['custom_af_url']
        ) if 'custom_af_url' in settings else self.url + ':7499'
        self.team = str(settings['team'])
        self.api_user_id = str(
            settings['api_user_id']) if 'api_user_id' in settings else ''
        self.api_signature = str(
            settings['api_signature']) if 'api_signature' in settings else ''
        self.af_version = str(
            settings['af_version']) if 'af_version' in settings else 'v2.2'
        self.verify = bool(
            settings['verify']) if 'verify' in settings else True

        self.token = ''
        self.login_time = 0
        self.ttl = 840  # Session TTL == 14 mins

        self.auth = Auth(self)
        self.subchannels = Subchannel(self)
        self.lists = List(self)
        self.users = User(self)
        self.channels = Channel(self)
        self.policies = Policy(self)
        self.events = Event(self)
        self.roles = Role(self)
        self.abtests = ABTest(self)
        self.af = AFClient(self)
        self.cases = Case(self)
        self.settings = Settings(self)
        self.queues = Queue(self)
        self.sessions = Session(self)
        self.tech = Tech(self)
        self.bi = BusinessIntelligence(self)
        self.schema = Schema(self)
        self.currencies = Currency(self)
        self.geo = Geo(self)
        self.bins = Bin(self)
        self.reports = Report(self)
示例#4
0
 def setUp(self):
     self.events = Event(
         PropertyMock(url='test_url',
                      team='test_team',
                      signature='test_signature',
                      token='old_value',
                      verify=True,
                      r=Mock(return_value=(200, {
                          'token': '123'
                      }))))
     self.channel = "payment"
     self.sub_channel = "test"
     self.query = "amount > 0"
     self.start = 1595241235974
     self.end = 1596450835974
     self.limit = 10