Merge branch 'fix-test-0377' into 'master'

Fix test for 0377 and update DOAP

See merge request poezio/slixmpp!243
This commit is contained in:
Nicoco K 2023-04-04 10:49:29 +00:00
commit 6d6fdc6419
2 changed files with 8 additions and 12 deletions

View File

@ -784,7 +784,7 @@
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0377.html"/>
<xmpp:status>complete</xmpp:status>
<xmpp:version>0.2</xmpp:version>
<xmpp:version>0.3</xmpp:version>
<xmpp:since>1.6.0</xmpp:since>
</xmpp:SupportedXep>
</implements>

View File

@ -23,34 +23,30 @@ class TestSpamReporting(SlixTest):
report = """
<iq type="set">
<block xmlns="urn:xmpp:blocking">
<report xmlns="urn:xmpp:reporting:0">
<spam/>
</report>
<report xmlns="urn:xmpp:reporting:1" reason="urn:xmpp:reporting:spam"/>
</block>
</iq>
"""
iq = self.Iq()
iq['type'] = 'set'
iq['block']['report']['spam'] = True
iq['block']['report']['reason'] = xep_0377.XEP_0377.SPAM
self.check(iq, report)
self.check(iq, report, use_values=False)
def testEnforceOnlyOneSubElement(self):
report = """
<iq type="set">
<block xmlns="urn:xmpp:blocking">
<report xmlns="urn:xmpp:reporting:0">
<abuse/>
</report>
<report xmlns="urn:xmpp:reporting:1" reason="urn:xmpp:reporting:abuse"/>
</block>
</iq>
"""
iq = self.Iq()
iq['type'] = 'set'
iq['block']['report']['spam'] = True
iq['block']['report']['abuse'] = True
self.check(iq, report)
iq['block']['report']['reason'] = xep_0377.XEP_0377.SPAM
iq['block']['report']['reason'] = xep_0377.XEP_0377.ABUSE
self.check(iq, report, use_values=False)
suite = unittest.TestLoader().loadTestsFromTestCase(TestSpamReporting)