本文整理汇总了Python中server.Server.setProjectMetadata方法的典型用法代码示例。如果您正苦于以下问题:Python Server.setProjectMetadata方法的具体用法?Python Server.setProjectMetadata怎么用?Python Server.setProjectMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类server.Server
的用法示例。
在下文中一共展示了Server.setProjectMetadata方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_projectMetadata
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import setProjectMetadata [as 别名]
def test_projectMetadata(self) :
s = Server("fixture")
s.createServer()
s.createProject("myproject")
s.setProjectMetadata("myproject",
key1 = "value1",
key2 = [4,3,2],
)
self.assertEqual(s.projectMetadata("myproject"),
{'key1': 'value1', 'key2' : [4,3,2]})
示例2: test_projectMetadata_updates
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import setProjectMetadata [as 别名]
def test_projectMetadata_updates(self) :
s = Server("fixture")
s.createServer()
s.createProject("myproject")
s.setProjectMetadata("myproject",
key1 = "first",
key2 = [4,3,2],
)
s.setProjectMetadata("myproject",
key1 = "second",
key3 = [7,8,9],
)
self.assertEqual(s.projectMetadata("myproject"),
{'key1': 'second', 'key2' : [4,3,2], 'key3' : [7,8,9]})
示例3: test_project_noClients
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import setProjectMetadata [as 别名]
def test_project_noClients(self) :
s = Server("fixture")
s.createServer()
s.createProject("myproject")
s.setProjectMetadata("myproject",
description = "project description",
briefDescription = "project brief description",
)
s.now = datetime.datetime(2013,9,1,2,3,4)
w = JsonSummary()
result = w.project(s, 'myproject')
self.assertMultiLineEqual(result,
'{'
' "project" : "myproject",\n'
' "lastupdate" : "2013/09/01 02:03:04",\n'
' "clients" : [\n'
' ]\n'
'}'
)