def test_to_json(self): config = Configuration( webhook='https://mybot.com/incoming', features={'manuallySendReadReceipts': True}, static_keyboard=SuggestedResponseKeyboard( responses=[ TextResponse('foo') ] ) ) self.assertEqual(config.to_json(), { 'webhook': 'https://mybot.com/incoming', 'features': { 'manuallySendReadReceipts': True }, 'staticKeyboard': { 'type': 'suggested', 'responses': [ { 'type': 'text', 'body': 'foo' } ] } })
def test_to_json_no_features(self): config = Configuration(webhook='https://mybot.com/incoming') self.assertEqual(config.to_json(), { 'webhook': 'https://mybot.com/incoming', 'features': {} })
def test_to_json_no_features(self): config = Configuration( webhook='https://mybot.com/incoming' ) self.assertEqual(config.to_json(), { 'webhook': 'https://mybot.com/incoming', 'features': {} })
def test_to_json(self): config = Configuration(webhook='https://mybot.com/incoming', features={'manuallySendReadReceipts': True}) self.assertEqual( config.to_json(), { 'webhook': 'https://mybot.com/incoming', 'features': { 'manuallySendReadReceipts': True } })
def test_to_json(self): config = Configuration( webhook='https://mybot.com/incoming', features={'manuallySendReadReceipts': True} ) self.assertEqual(config.to_json(), { 'webhook': 'https://mybot.com/incoming', 'features': { 'manuallySendReadReceipts': True } })
def test_to_json(self): config = Configuration(webhook='https://mybot.com/incoming', features={'manuallySendReadReceipts': True}, static_keyboard=SuggestedResponseKeyboard( responses=[TextResponse('foo')])) self.assertEqual( config.to_json(), { 'webhook': 'https://mybot.com/incoming', 'features': { 'manuallySendReadReceipts': True }, 'staticKeyboard': { 'type': 'suggested', 'responses': [{ 'type': 'text', 'body': 'foo' }] } })