Example #1
0
 def test_content_type(self):
     ce = CallbackEvent()
     self.assertEqual(ce.content_type, None)
     ce.event_payload = get_sample_data('addAttachmentToCard', 'text')
     ce.event_type = 'addAttachmentToCard'
     ce.resolve_content_type()
     self.assertEqual(ce.content_type, ce.event_payload['action']['data']
                      ['attachment']['content_type'])  # noqa
Example #2
0
 def test_resolve_content_type(self):
     ce = CallbackEvent()
     ce.event_payload = get_sample_data('addAttachmentToCard', 'text')
     ce.event_type = 'addAttachmentToCard'
     ce.resolve_content_type()
     self.assertEqual(ce.content_type, "image/jpeg")