diff options
author | louiz’ <louiz@louiz.org> | 2020-03-11 00:32:18 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2020-03-11 00:32:18 +0100 |
commit | fc22e06317c8f4df984ab29e6457b7c7e0adafd8 (patch) | |
tree | a9daf3cb11a709eb85f683a5c68f94299c5b38d3 /tests/end_to_end | |
parent | 40d2168ae5dbee4823083058ad8d94f80a3080b5 (diff) | |
download | biboumi-fc22e06317c8f4df984ab29e6457b7c7e0adafd8.tar.gz biboumi-fc22e06317c8f4df984ab29e6457b7c7e0adafd8.tar.bz2 biboumi-fc22e06317c8f4df984ab29e6457b7c7e0adafd8.tar.xz biboumi-fc22e06317c8f4df984ab29e6457b7c7e0adafd8.zip |
Fix a type stable-id -> stanza-id, and add a test case to be exhaustive
Diffstat (limited to 'tests/end_to_end')
-rw-r--r-- | tests/end_to_end/scenarios/stable_id.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/end_to_end/scenarios/stable_id.py b/tests/end_to_end/scenarios/stable_id.py index 90b5866..9f3181b 100644 --- a/tests/end_to_end/scenarios/stable_id.py +++ b/tests/end_to_end/scenarios/stable_id.py @@ -8,19 +8,25 @@ scenario = ( scenarios.simple_channel_join.scenario, send_stanza("""<message id='first_id' from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}' type='groupchat'> - <origin-id xmlns='urn:xmpp:sid:0' id='client-origin-id'/> - <stanza-id xmlns='urn:xmpp:sid:0' id='client-stanza-id'/> + <origin-id xmlns='urn:xmpp:sid:0' id='client-origin-id-should-be-kept'/> + <stanza-id xmlns='urn:xmpp:sid:0' id='client-stanza-id-should-be-removed' by='#foo%{irc_server_one}'/> + <stanza-id xmlns='urn:xmpp:sid:0' id='client-stanza-id-should-be-kept' by='someother@jid'/> <body>coucou</body></message>"""), # Entities, which are routing stanzas, SHOULD NOT strip any elements # qualified by the 'urn:xmpp:sid:0' namespace from message stanzas # unless the preceding rule applied to those elements. - expect_stanza("/message/stable_id:origin-id[@id='client-origin-id']", + expect_stanza("/message/stable_id:origin-id[@id='client-origin-id-should-be-kept']", # Stanza ID generating entities, which encounter a <stanza-id/> # element where the 'by' attribute matches the 'by' attribute they # would otherwise set, MUST delete that element even if they are not # adding their own stanza ID. "/message/stable_id:stanza-id[@id][@by='#foo%{irc_server_one}']", - "!/message/stable_id:stanza-id[@id='client-stanza-id']", + "!/message/stable_id:stanza-id[@id='client-stanza-id-should-be-removed']", + # Entities, which are routing stanzas, SHOULD NOT strip + # any elements qualified by the 'urn:xmpp:sid:0' + # namespace from message stanzas unless the preceding + # rule applied to those elements. + "/message/stable_id:stanza-id[@id='client-stanza-id-should-be-kept'][@by='someother@jid']", ), ) |