def test_to_dict_for_logo_without_lang(self): desc = UIInfoDesc() desc.add_logo("logo.jpg", 80, 80, None) serialized = desc.to_dict() ui_info = serialized["service"]["idp"]["ui_info"] assert ui_info["logo"] == [{"text": "logo.jpg", "width": 80, "height": 80}]
def test_to_dict(self): desc = UIInfoDesc() desc.add_description("test", "en") desc.add_display_name("my company", "en") desc.add_logo("logo.jpg", 80, 80, "en") serialized = desc.to_dict() ui_info = serialized["service"]["idp"]["ui_info"] assert ui_info["description"] == [{"text": "test", "lang": "en"}] assert ui_info["display_name"] == [{"text": "my company", "lang": "en"}] assert ui_info["logo"] == [{"text": "logo.jpg", "width": 80, "height": 80, "lang": "en"}]
def test_to_dict_with_empty(self): desc = UIInfoDesc() assert desc.to_dict() == {}