コード例 #1
0
    def test_as_dict(self, title, subtitle, image_url, buttons):
        card_obj = Card(title=title,
                        subtitle=subtitle,
                        image_url=image_url,
                        buttons=buttons)

        assert card_obj._as_dict() == {
            'card': {
                'title': title,
                'subtitle': subtitle,
                'imageUri': image_url,
                'buttons': buttons
            }
        }
コード例 #2
0
    def test_button_empty_params(self):
        card_obj = Card(buttons=[{}])

        assert card_obj._as_dict() == {'card': {'buttons': [{}]}}
コード例 #3
0
    def test_empty_params(self):
        card_obj = Card()

        assert card_obj._as_dict() == {'card': {}}