Example #1
0
    def invoke_register_event_request(
        self
        , server='localhost'
        , provider='rb'
        , subscriber='NLS'
        , sport='FOOTBALL'
        , provider_event_id='611582'
        , subscriber_event_id='1002755831'
        , callback_url='http://localhost:5000'
    ):
        callback_url_param = ''
        if callback_url is not None:
            callback_url_param = self.CALLBACK_URL_PARAM.format(callback_url)

        request = RequestDetails(
            uri=self.REQUEST_URI.format(self.HOSTS[server])
            , method=self.REQUEST_METHOD
            , params=self.REQUEST_PARAMS
            , data=self.REQUEST_DATA.format(self.PROVIDERS[provider], subscriber, sport, provider_event_id, subscriber_event_id).replace('$callback_url', callback_url_param)
            , headers=self.HEADERS
            , name='RegisterEvent'
        )

        response = Poster.post(request)
        if response is not None:
            logging.info("Response: {}".format(response))
            logging.info("Response: {}".format(response.text))
Example #2
0
 def invoke_schedule_event_request(
     self
     , server='localhost'
     , provider='img'
     , subscriber='NLS'
     , sport='TENNIS'
     , provider_event_id='2016-0301-MS004'
     , subscriber_event_id='1002911031'
 ):
     p = Poster()
     request = RequestDetails(
             uri=self.REQUEST_URI.format(self.HOSTS[server])
             , method=self.REQUEST_METHOD
             , params=self.REQUEST_PARAMS
             , data=self.REQUEST_DATA_01.format(provider_event_id, subscriber_event_id, provider_event_id)
             , headers=self.HEADERS
             , name='RegisterEvent'
         )
     p.post(request)
Example #3
0
    def invoke_match_list_request(self, server='test09-v1', provider='rb', sport='FOOTBALL'):
        request = RequestDetails(
            uri=self.REQUEST_URI.format(self.HOSTS[server])
            , method=self.REQUEST_METHOD
            , params=self.REQUEST_PARAMS
            , data=self.REQUEST_DATA.format(self.PROVIDERS[provider], sport, Util.current_millis())
            , headers=self.HEADERS
            , name='MatchlistRequest'
        )

        response = Poster.post(request)
        if response is not None:
            logging.info("Response: {}".format(response))
            logging.info("Response: {}".format(response.text))