def test_send_uses_build_params_for_parameters_building(self): api = APILatest(token='some-token', transport=DummyReturnTransport()) self.assertDictEqual( api.send('Test', 'Test'), api._build_params_from_kwargs( token='some-token', title='Test', body='Test', is_important=False, is_silent=False ) )
def test_send_with_icon(self): api = APILatest(token='some-token', transport=DummyReturnTransport()) self.assertDictEqual( api.send_with_image( 'test', 'test', image='http://the-bosha.ru/favicon.ico' ), self._param_builder( api=api, title='test', body='test', image='http://the-bosha.ru/favicon.ico', ) )
def test_send_with_link_without_link_title(self): api = APILatest(token='some-token', transport=DummyReturnTransport()) self.assertDictEqual( api.send_with_link( 'test', 'test', link='http://the-bosha.ru' ), self._param_builder( api=api, title='test', body='test', link='http://the-bosha.ru', link_title='http://the-bosha.ru' ) )
def test_send_with_expiry(self): api = APILatest(token='some-token', transport=DummyReturnTransport()) self.assertDictEqual( api.send_with_expiry('test', 'test', ttl=1), self._param_builder(api=api, title='test', body='test', ttl=1) )
def test_send_important_message(self): api = APILatest(token='some-token', transport=DummyReturnTransport()) self.assertDictEqual( api.send_important_message('test', 'test'), self._param_builder(api=api, title='test', body='test', important=True) )