本文整理汇总了Python中dulwich.objects.Tag.set_raw_string方法的典型用法代码示例。如果您正苦于以下问题:Python Tag.set_raw_string方法的具体用法?Python Tag.set_raw_string怎么用?Python Tag.set_raw_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dulwich.objects.Tag
的用法示例。
在下文中一共展示了Tag.set_raw_string方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_parse
# 需要导入模块: from dulwich.objects import Tag [as 别名]
# 或者: from dulwich.objects.Tag import set_raw_string [as 别名]
def test_parse(self):
x = Tag()
x.set_raw_string(self.make_tag_text())
self.assertEqual("Linus Torvalds <[email protected]>", x.tagger)
self.assertEqual("v2.6.22-rc7", x.name)
object_type, object_sha = x.object
self.assertEqual("a38d6181ff27824c79fc7df825164a212eff6a3f", object_sha)
self.assertEqual(Commit, object_type)
self.assertEqual(datetime.datetime.utcfromtimestamp(x.tag_time), datetime.datetime(2007, 7, 1, 19, 54, 34))
self.assertEqual(-25200, x.tag_timezone)
示例2: test_parse_no_message
# 需要导入模块: from dulwich.objects import Tag [as 别名]
# 或者: from dulwich.objects.Tag import set_raw_string [as 别名]
def test_parse_no_message(self):
x = Tag()
x.set_raw_string(self.make_tag_text(message=None))
self.assertEqual(None, x.message)
self.assertEqual(
b'Linus Torvalds <[email protected]>', x.tagger)
self.assertEqual(datetime.datetime.utcfromtimestamp(x.tag_time),
datetime.datetime(2007, 7, 1, 19, 54, 34))
self.assertEqual(-25200, x.tag_timezone)
self.assertEqual(b'v2.6.22-rc7', x.name)
示例3: test_parse_no_tagger
# 需要导入模块: from dulwich.objects import Tag [as 别名]
# 或者: from dulwich.objects.Tag import set_raw_string [as 别名]
def test_parse_no_tagger(self):
x = Tag()
x.set_raw_string("""object a38d6181ff27824c79fc7df825164a212eff6a3f
type commit
tag v2.6.22-rc7
Linux 2.6.22-rc7
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQBGiAaAF3YsRnbiHLsRAitMAKCiLboJkQECM/jpYsY3WPfvUgLXkACgg3ql
OK2XeQOiEeXtT76rV4t2WR4=
=ivrA
-----END PGP SIGNATURE-----
""")
self.assertEquals(None, x.tagger)
self.assertEquals("v2.6.22-rc7", x.name)
示例4: test_parse_ctime
# 需要导入模块: from dulwich.objects import Tag [as 别名]
# 或者: from dulwich.objects.Tag import set_raw_string [as 别名]
def test_parse_ctime(self):
x = Tag()
x.set_raw_string("""object a38d6181ff27824c79fc7df825164a212eff6a3f
type commit
tag v2.6.22-rc7
tagger Linus Torvalds <[email protected]> Sun Jul 1 12:54:34 2007 -0700
Linux 2.6.22-rc7
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQBGiAaAF3YsRnbiHLsRAitMAKCiLboJkQECM/jpYsY3WPfvUgLXkACgg3ql
OK2XeQOiEeXtT76rV4t2WR4=
=ivrA
-----END PGP SIGNATURE-----
""")
self.assertEquals("Linus Torvalds <[email protected]>", x.tagger)
self.assertEquals("v2.6.22-rc7", x.name)
示例5: test_parse_no_tagger
# 需要导入模块: from dulwich.objects import Tag [as 别名]
# 或者: from dulwich.objects.Tag import set_raw_string [as 别名]
def test_parse_no_tagger(self):
x = Tag()
x.set_raw_string(self.make_tag_text(tagger=None))
self.assertEquals(None, x.tagger)
self.assertEquals("v2.6.22-rc7", x.name)