jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/425116 )
Change subject: [bugfix] ensure that Timestamp.microsecond is not 0
......................................................................
[bugfix] ensure that Timestamp.microsecond is not 0
ensure that Timestamp.microsecond is not 0 when compairing with
mediawiki timestamp.
Bug: T191827
Change-Id: I523eb3f264e0ddd13cff9cf9c6762d23260399ce
---
M tests/timestamp_tests.py
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/timestamp_tests.py b/tests/timestamp_tests.py
index f6c76b8..9b893f3 100644
--- a/tests/timestamp_tests.py
+++ b/tests/timestamp_tests.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Tests for the Timestamp class."""
#
-# (C) Pywikibot team, 2014-2017
+# (C) Pywikibot team, 2014-2018
#
# Distributed under the terms of the MIT license.
#
@@ -80,6 +80,8 @@
def test_mediawiki_format(self):
"""Test conversion from and to timestamp
format."""
t1 = Timestamp.utcnow()
+ if not t1.microsecond: # T191827: ensure microsecond is not 0
+ t1 = t1.replace(microsecond=1000)
ts1 = t1.totimestampformat()
t2 = Timestamp.fromtimestampformat(ts1)
ts2 = t2.totimestampformat()
--
To view, visit
https://gerrit.wikimedia.org/r/425116
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I523eb3f264e0ddd13cff9cf9c6762d23260399ce
Gerrit-Change-Number: 425116
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>