Exemplo n.º 1
0
 def send_message(self, to_mid, message):
     request = Request(**{
         'url': self.__generate_url('events'),
         'credentials': self.credentials,
         'to_mid': to_mid,
         'message': message,
     })
     request.validate()
     return request.post()
Exemplo n.º 2
0
 def send_message(self, to_mid, message):
     request = Request(**{
         'url': self.__generate_url('events'),
         'credentials': self.credentials,
         'to_mid': to_mid,
         'message': message,
     })
     request.validate()
     return request.post()
Exemplo n.º 3
0
 def test_request_instance_creation(self, fx_client, fx_message, mocking):
     url = 'https://trialbot-api.line.me/v1/events'
     request = Request(
         url=url,
         credentials=fx_client.credentials,
         to_mid=[mocking['mid']],
         message=fx_message,
     )
     assert request.url == url
     assert request.headers == {
         'Content-Type':
         'application/json; charset=UTF-8',
         'X-Line-ChannelID':
         fx_client.credentials['X-Line-ChannelID'],
         'X-Line-ChannelSecret':
         fx_client.credentials['X-Line-ChannelSecret'],
         'X-Line-Trusted-User-With-ACL':
         fx_client.credentials['X-Line-Trusted-User-With-ACL'],
     }
Exemplo n.º 4
0
 def __get(self, url):
     request = Request(**{
         'url': url,
         'credentials': self.credentials,
     })
     return request.get()
Exemplo n.º 5
0
 def __get(self, url):
     request = Request(**{
         'url': url,
         'credentials': self.credentials,
     })
     return request.get()