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:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0377.html"/> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0377.html"/>
<xmpp:status>complete</xmpp:status> <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:since>1.6.0</xmpp:since>
</xmpp:SupportedXep> </xmpp:SupportedXep>
</implements> </implements>

View File

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