summaryrefslogtreecommitdiff
path: root/tests/test_stream_xep_0323.py
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-08-02 21:26:56 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-08-02 21:27:19 +0200
commit0f690d400586829e9ee7bee69dc19ffe09ff9f58 (patch)
treec61882f7a24e92a49807c2607029fbedc0c383db /tests/test_stream_xep_0323.py
parent59d4420739db20b204bb15a2880de871316aa70f (diff)
downloadslixmpp-0f690d400586829e9ee7bee69dc19ffe09ff9f58.tar.gz
slixmpp-0f690d400586829e9ee7bee69dc19ffe09ff9f58.tar.bz2
slixmpp-0f690d400586829e9ee7bee69dc19ffe09ff9f58.tar.xz
slixmpp-0f690d400586829e9ee7bee69dc19ffe09ff9f58.zip
tests: Fix the XEP-0323 stream test, broken since 59d4420739db20b204bb15a2880de871316aa70f.
Thanks debacle!
Diffstat (limited to 'tests/test_stream_xep_0323.py')
-rw-r--r--tests/test_stream_xep_0323.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_stream_xep_0323.py b/tests/test_stream_xep_0323.py
index 42230e1f..b4c18afc 100644
--- a/tests/test_stream_xep_0323.py
+++ b/tests/test_stream_xep_0323.py
@@ -4,6 +4,7 @@ import sys
import datetime
import time
import threading
+import re
from slixmpp.test import *
from slixmpp.xmlstream import ElementBase
@@ -771,7 +772,7 @@ class TestStreamSensorData(SlixTest):
# Remove the returned datetime to allow predictable test
xml_stanza = self._filtered_stanza_prepare()
error_text = xml_stanza['rejected']['error'] #['text']
- error_text = error_text[:error_text.find(':')]
+ error_text = re.sub(r'\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[\+\-]\d{2}:\d{2})?', '…', error_text)
xml_stanza['rejected']['error'] = error_text
self._filtered_stanza_check("""
@@ -780,7 +781,7 @@ class TestStreamSensorData(SlixTest):
to='master@clayster.com/amr'
id='1'>
<rejected xmlns='urn:xmpp:iot:sensordata' seqnr='1'>
- <error>Invalid datetime in 'when' flag, cannot set a time in the past. Current time</error>
+ <error>Invalid datetime in 'when' flag, cannot set a time in the past (…). Current time: …</error>
</rejected>
</iq>
""", xml_stanza)