mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 14:30:30 +03:00
scanner: switch form iso8601 to unix timestamp for python3.5 support
This commit is contained in:
parent
9560ed955c
commit
59b1899d79
2 changed files with 9 additions and 9 deletions
|
|
@ -508,19 +508,19 @@ class Test_SignatureDataController(unittest.TestCase):
|
|||
# check_last_updated
|
||||
def test_check_last_updated_ok(self):
|
||||
sdc = fdroidserver.scanner.SignatureDataController('nnn', 'fff.yml', 'https://example.com/test.json')
|
||||
sdc.data['last_updated'] = datetime.utcnow().isoformat()
|
||||
sdc.data['last_updated'] = datetime.utcnow().timestamp()
|
||||
sdc.check_last_updated()
|
||||
|
||||
def test_check_last_updated_exception_cache_outdated(self):
|
||||
sdc = fdroidserver.scanner.SignatureDataController('nnn', 'fff.yml', 'https://example.com/test.json')
|
||||
sdc.cache_duration = timedelta(days=7)
|
||||
sdc.data['last_updated'] = (datetime.utcnow() - timedelta(days=30)).isoformat()
|
||||
sdc.data['last_updated'] = (datetime.utcnow() - timedelta(days=30)).timestamp()
|
||||
with self.assertRaises(fdroidserver.scanner.SignatureDataOutdatedException):
|
||||
sdc.check_last_updated()
|
||||
|
||||
def test_check_last_updated_exception_not_string(self):
|
||||
sdc = fdroidserver.scanner.SignatureDataController('nnn', 'fff.yml', 'https://example.com/test.json')
|
||||
sdc.data['last_updated'] = 12345
|
||||
sdc.data['last_updated'] = 'sepp'
|
||||
with self.assertRaises(fdroidserver.scanner.SignatureDataMalformedException):
|
||||
sdc.check_last_updated()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue