本文整理匯總了Python中apidoc.object.source_raw.Version.status方法的典型用法代碼示例。如果您正苦於以下問題:Python Version.status方法的具體用法?Python Version.status怎麽用?Python Version.status使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類apidoc.object.source_raw.Version
的用法示例。
在下文中一共展示了Version.status方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_version
# 需要導入模塊: from apidoc.object.source_raw import Version [as 別名]
# 或者: from apidoc.object.source_raw.Version import status [as 別名]
def test_version(self):
version = Version()
version.name = "a"
version.description = "b"
version.uri = "c"
version.major = 2
version.minor = 3
version.status = Version.Status.draft
version_dto = VersionDto(version)
self.assertEqual("a", version_dto.name)
self.assertEqual("b", version_dto.description)
self.assertEqual("c", version_dto.uri)
self.assertEqual(2, version_dto.major)
self.assertEqual(3, version_dto.minor)
示例2: create_from_name_and_dictionary
# 需要導入模塊: from apidoc.object.source_raw import Version [as 別名]
# 或者: from apidoc.object.source_raw.Version import status [as 別名]
def create_from_name_and_dictionary(self, name, datas):
"""Return a populated object Version from dictionary datas
"""
version = ObjectVersion()
self.set_common_datas(version, name, datas)
if "uri" in datas:
version.uri = str(datas["uri"])
if "major" in datas:
version.major = int(datas["major"])
if "minor" in datas:
version.minor = int(datas["minor"])
if "status" in datas:
version.status = self.get_enum("status", ObjectVersion.Status, datas)
version.methods = self.method_factory.create_dictionary_of_element_from_dictionary("methods", datas)
version.types = self.type_factory.create_dictionary_of_element_from_dictionary("types", datas)
version.references = self.reference_factory.create_dictionary_of_element_from_dictionary("references", datas)
return version