[github] strip the final 'Z' of the date and update the test

This commit is contained in:
依云 2016-03-14 15:20:04 +08:00
parent 3c97b5c693
commit 9df0bb5433
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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")