XEP-0030: fix tests

Use None as the "no value" value, rather than ''.
This commit is contained in:
mathieui 2024-12-26 09:42:33 +01:00
parent 7153d79006
commit fbf298c36d
No known key found for this signature in database
GPG Key ID: C59F84CEEFD616E3

View File

@ -165,9 +165,9 @@ class DiscoInfo(ElementBase):
identities = []
for id_xml in self.xml.findall('{%s}identity' % self.namespace):
xml_lang = id_xml.attrib.get('{%s}lang' % self.xml_ns, None)
category = id_xml.attrib.get('category', '')
type_ = id_xml.attrib.get('type', '')
name = id_xml.attrib.get('name', '')
category = id_xml.attrib.get('category', None)
type_ = id_xml.attrib.get('type', None)
name = id_xml.attrib.get('name', None)
if lang is None or xml_lang == lang:
id = (category, type_, xml_lang, name)
if isinstance(identities, set):
@ -253,7 +253,7 @@ class DiscoInfo(ElementBase):
else:
features = []
for feature_xml in self.xml.findall('{%s}feature' % self.namespace):
feature = feature_xml.attrib.get('var', '')
feature = feature_xml.attrib.get('var', None)
if feature:
if isinstance(features, set):
features.add(feature)