def test_card_big_image_card_method(self): card_big_image = types.Card.big_image( IMAGE_ID, CARD_TITLE, CARD_DESCR, types.MediaButton(BUTTON_TEXT, URL, MB_PAYLOAD), types.CardFooter(FOOTER_TEXT, MEDIA_BUTTON) ) self._assert_payload(card_big_image, EXPECTED_CARD_BIG_IMAGE_JSON)
def test_response_items_list_from_request(self): alice_request = types.AliceRequest(None, **ALICE_REQUEST) alice_response = alice_request.response_items_list( RESPONSE_TEXT, CARD_HEADER_TEXT, [types.Image(**IMAGE)], types.CardFooter(**FOOTER), buttons=[RESPONSE_BUTTON]) self._assert_payload(alice_response, EXPECTED_ALICE_RESPONSE_ITEMS_LIST_WITH_BUTTON)
def test_response_big_image_from_request(self): alice_request = types.AliceRequest(**ALICE_REQUEST) alice_response = alice_request.response_big_image( RESPONSE_TEXT, IMAGE_ID, CARD_TITLE, CARD_DESCR, types.MediaButton(BUTTON_TEXT, URL, MB_PAYLOAD), types.CardFooter(FOOTER_TEXT, MEDIA_BUTTON), buttons=[RESPONSE_BUTTON] ) self._assert_payload(alice_response, EXPECTED_ALICE_RESPONSE_BIG_IMAGE_WITH_BUTTON)
def test_card_big_image(self): card_big_image = types.Card( types.CardType.BIG_IMAGE, image_id=IMAGE_ID, title=CARD_TITLE, description=CARD_DESCR, button=types.MediaButton(BUTTON_TEXT, URL, MB_PAYLOAD), footer=types.CardFooter(FOOTER_TEXT, MEDIA_BUTTON) ) self._assert_payload(card_big_image, EXPECTED_CARD_BIG_IMAGE_JSON)
def test_card_footer(self): card_footer = types.CardFooter(FOOTER_TEXT, FOOTER['button']) self._test_card_footer(card_footer, FOOTER)