changeset 18199:24f5bec1601f stable

test-command-template.t: fix test so it all year This test started failing for me after midnight UTC on December 31st. Fixed it by specifying a date 7 years in the future more precisely (rather than just adding 8 to the year and specifying January 1st), which allows the test to pass both now and on 2012-12-01 at the same time.
author Augie Fackler <raf@durin42.com>
date Mon, 31 Dec 2012 21:50:35 -0600
parents 9b4adaef0db9
children a4765077b65e
files tests/test-command-template.t
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-command-template.t	Sun Dec 30 03:49:15 2012 +0100
+++ b/tests/test-command-template.t	Mon Dec 31 21:50:35 2012 -0600
@@ -1348,7 +1348,8 @@
 
   >>> from datetime import datetime
   >>> fp = open('a', 'w')
-  >>> fp.write(str(datetime.now().year + 8) + '-01-01 00:00')
+  >>> n = datetime.now()
+  >>> fp.write('%d-%d-%d 00:00' % ((n.year + 7), n.month, n.day))
   >>> fp.close()
   $ hg add a
   $ hg commit -m future -d "`cat a`"