From 9df0bb5433245d065dbde971865cc76772d96614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E4=BA=91?= Date: Mon, 14 Mar 2016 15:20:04 +0800 Subject: [PATCH] [github] strip the final 'Z' of the date and update the test --- nvchecker/source/github.py | 2 +- tests/test_github.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nvchecker/source/github.py b/nvchecker/source/github.py index c77f1d8..191bddc 100644 --- a/nvchecker/source/github.py +++ b/nvchecker/source/github.py @@ -39,5 +39,5 @@ def _github_done(name, use_latest_release, use_max_tag, ignored_tags, callback, else: # YYYYMMDD.HHMMSS version = data[0]['commit']['committer']['date'] \ - .replace('-', '').replace(':', '').replace('T', '.') + .rstrip('Z').replace('-', '').replace(':', '').replace('T', '.') callback(name, version) diff --git a/tests/test_github.py b/tests/test_github.py index 2d2146d..b4ebb52 100644 --- a/tests/test_github.py +++ b/tests/test_github.py @@ -7,7 +7,7 @@ from tests.helper import ExternalVersionTestCase reason="requires NVCHECKER_GITHUB_TOKEN, or it fails too much") class GitHubTest(ExternalVersionTestCase): def test_github(self): - self.assertEqual(self.sync_get_version("example", {"github": "harry-sanabria/ReleaseTestRepo"}), "20140122") + self.assertEqual(self.sync_get_version("example", {"github": "harry-sanabria/ReleaseTestRepo"}), "20140122.012101") def test_github_latest_release(self): self.assertEqual(self.sync_get_version("example", {"github": "harry-sanabria/ReleaseTestRepo", "use_latest_release": 1}), "release3")