use '5 years ago' instead of absolute timestamp

This commit is contained in:
meejah 2017-12-20 13:17:54 -07:00
parent 1dc129b15d
commit e5d6272b62

View File

@ -3,6 +3,7 @@ import shutil
import os.path
import mock
import re
import time
from twisted.trial import unittest
from twisted.internet import defer
@ -293,6 +294,8 @@ class StatusMagicFolder(MagicFolderCLITestMixin, unittest.TestCase):
@defer.inlineCallbacks
def test_status(self):
secs_per_year = 365 * 24 * 60 * 60.0
def json_for_cap(options, cap):
if cap.startswith('URI:DIR2:'):
return (
@ -303,7 +306,7 @@ class StatusMagicFolder(MagicFolderCLITestMixin, unittest.TestCase):
"size": 1234,
"metadata": {
"tahoe": {
"linkcrtime": 0.0,
"linkcrtime": (time.time() - (5 * secs_per_year)),
},
"version": 1,
},
@ -332,7 +335,7 @@ class StatusMagicFolder(MagicFolderCLITestMixin, unittest.TestCase):
self.assertIn("default", stdout)
self.assertIn(
"foo (1.23 kB): good, version=1, created 47 years ago",
"foo (1.23 kB): good, version=1, created 5 years ago",
stdout,
)