From 0f690d400586829e9ee7bee69dc19ffe09ff9f58 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 2 Aug 2018 21:26:56 +0200 Subject: [PATCH] tests: Fix the XEP-0323 stream test, broken since 59d4420739db20b204bb15a2880de871316aa70f. Thanks debacle! --- tests/test_stream_xep_0323.py | 5 +++-- 1 file 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'> - Invalid datetime in 'when' flag, cannot set a time in the past. Current time + Invalid datetime in 'when' flag, cannot set a time in the past (…). Current time: … """, xml_stanza)