Changeset View
Changeset View
Standalone View
Standalone View
swh/model/tests/test_identifiers.py
Show First 20 Lines • Show All 364 Lines • ▼ Show 20 Lines | -----END PGP SIGNATURE-----""" | ||||
"name": b"Linus Torvalds", | "name": b"Linus Torvalds", | ||||
"email": b"torvalds@linux-foundation.org", | "email": b"torvalds@linux-foundation.org", | ||||
"fullname": b"Linus Torvalds <torvalds@linux-foundation.org>", | "fullname": b"Linus Torvalds <torvalds@linux-foundation.org>", | ||||
}, | }, | ||||
"committer_date": datetime.datetime( | "committer_date": datetime.datetime( | ||||
2015, 7, 12, 15, 10, 30, tzinfo=linus_tz | 2015, 7, 12, 15, 10, 30, tzinfo=linus_tz | ||||
), | ), | ||||
"message": b"Linux 4.2-rc2\n", | "message": b"Linux 4.2-rc2\n", | ||||
"metadata": { | "extra_headers": ( | ||||
"extra_headers": [ | (b"svn-repo-uuid", b"046f1af7-66c2-d61b-5410-ce57b7db7bff"), | ||||
["svn-repo-uuid", "046f1af7-66c2-d61b-5410-ce57b7db7bff"], | (b"svn-revision", b"10"), | ||||
["svn-revision", 10], | ), | ||||
] | |||||
}, | |||||
} | } | ||||
self.revision_with_gpgsig = { | self.revision_with_gpgsig = { | ||||
"id": "44cc742a8ca17b9c279be4cc195a93a6ef7a320e", | "id": "44cc742a8ca17b9c279be4cc195a93a6ef7a320e", | ||||
"directory": _x("b134f9b7dc434f593c0bab696345548b37de0558"), | "directory": _x("b134f9b7dc434f593c0bab696345548b37de0558"), | ||||
"parents": [ | "parents": [ | ||||
_x("689664ae944b4692724f13b709a4e4de28b54e57"), | _x("689664ae944b4692724f13b709a4e4de28b54e57"), | ||||
_x("c888305e1efbaa252d01b4e5e6b778f865a97514"), | _x("c888305e1efbaa252d01b4e5e6b778f865a97514"), | ||||
], | ], | ||||
"author": { | "author": { | ||||
"name": b"Jiang Xin", | "name": b"Jiang Xin", | ||||
"email": b"worldhello.net@gmail.com", | "email": b"worldhello.net@gmail.com", | ||||
"fullname": b"Jiang Xin <worldhello.net@gmail.com>", | "fullname": b"Jiang Xin <worldhello.net@gmail.com>", | ||||
}, | }, | ||||
"date": {"timestamp": 1428538899, "offset": 480,}, | "date": {"timestamp": 1428538899, "offset": 480,}, | ||||
"committer": {"name": b"Jiang Xin", "email": b"worldhello.net@gmail.com",}, | "committer": {"name": b"Jiang Xin", "email": b"worldhello.net@gmail.com",}, | ||||
"committer_date": {"timestamp": 1428538899, "offset": 480,}, | "committer_date": {"timestamp": 1428538899, "offset": 480,}, | ||||
"metadata": {"extra_headers": [["gpgsig", gpgsig],],}, | "extra_headers": ((b"gpgsig", gpgsig),), | ||||
"message": b"""Merge branch 'master' of git://github.com/alexhenrie/git-po | "message": b"""Merge branch 'master' of git://github.com/alexhenrie/git-po | ||||
* 'master' of git://github.com/alexhenrie/git-po: | * 'master' of git://github.com/alexhenrie/git-po: | ||||
l10n: ca.po: update translation | l10n: ca.po: update translation | ||||
""", | """, | ||||
} | } | ||||
self.revision_no_message = { | self.revision_no_message = { | ||||
Show All 40 Lines | """, | ||||
"date": datetime.datetime(2015, 7, 12, 15, 10, 30, tzinfo=linus_tz), | "date": datetime.datetime(2015, 7, 12, 15, 10, 30, tzinfo=linus_tz), | ||||
"committer": { | "committer": { | ||||
"fullname": b"Linus Torvalds <torvalds@linux-foundation.org>", | "fullname": b"Linus Torvalds <torvalds@linux-foundation.org>", | ||||
}, | }, | ||||
"committer_date": datetime.datetime( | "committer_date": datetime.datetime( | ||||
2015, 7, 12, 15, 10, 30, tzinfo=linus_tz | 2015, 7, 12, 15, 10, 30, tzinfo=linus_tz | ||||
), | ), | ||||
"message": b"Linux 4.2-rc2\n", | "message": b"Linux 4.2-rc2\n", | ||||
"metadata": { | "extra_headers": ( | ||||
"extra_headers": [ | (b"svn-repo-uuid", b"046f1af7-66c2-d61b-5410-ce57b7db7bff"), | ||||
["svn-repo-uuid", "046f1af7-66c2-d61b-5410-ce57b7db7bff"], | (b"svn-revision", b"10"), | ||||
["svn-revision", 10], | ), | ||||
] | |||||
}, | |||||
} | } | ||||
def test_revision_identifier(self): | def test_revision_identifier(self): | ||||
self.assertEqual( | self.assertEqual( | ||||
identifiers.revision_identifier(self.revision), | identifiers.revision_identifier(self.revision), | ||||
identifiers.identifier_to_str(self.revision["id"]), | identifiers.identifier_to_str(self.revision["id"]), | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 604 Lines • Show Last 20 Lines |