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
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")