当前位置: 首页>>代码示例>>Python>>正文


Python Server.setClientMetadata方法代码示例

本文整理汇总了Python中server.Server.setClientMetadata方法的典型用法代码示例。如果您正苦于以下问题:Python Server.setClientMetadata方法的具体用法?Python Server.setClientMetadata怎么用?Python Server.setClientMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在server.Server的用法示例。


在下文中一共展示了Server.setClientMetadata方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUpEmptyClient

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import setClientMetadata [as 别名]
def setUpEmptyClient(project='myproject', client='myclient', **keyw) :
	s = Server("fixture")
	s.createServer()
	s.createProject(project)
	s.createClient(project,client)
	s.now = datetime.datetime(1900,1,1,0,0,0)
	s.clientIdle(project, client, 0)
	s.setClientMetadata(project,client,**keyw)
	return s
开发者ID:clam-project,项目名称:testfarm-server2,代码行数:11,代码来源:webgenerator_test.py

示例2: test_clientMetadata

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import setClientMetadata [as 别名]
	def test_clientMetadata(self) :
		s = Server("fixture")
		s.createServer()
		s.createProject("myproject")
		s.createClient("myproject","myclient")
		s.setClientMetadata("myproject", "myclient",
			key1 = "value1",
			key2 = [4,3,2],
			)
		self.assertEqual(s.clientMetadata("myproject","myclient"),
			{'key1': 'value1', 'key2' : [4,3,2]})
开发者ID:clam-project,项目名称:testfarm-server2,代码行数:13,代码来源:server_test.py

示例3: test_project_withClients

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import setClientMetadata [as 别名]
	def test_project_withClients(self) :
		s = Server("fixture")
		s.createServer()
		s.createProject("myproject")
		s.createClient("myproject","myclient")
		s.setClientMetadata("myproject", "myclient",
			description = "a description",
			briefDescription = "brief description",
			)
		s.createClient("myproject","yourclient")
		s.setClientMetadata("myproject", "yourclient",
			description = "your description",
			briefDescription = "your brief description",
			)

		# force an idle time
		s.now=datetime.datetime(2013,4,5,6,7,8)
		s.clientIdle("myproject", "myclient", 0)
		s.clientIdle("myproject", "yourclient", 0)

		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'
			'			"name": "myclient",\n'
			'			"description": \'a description\',\n'
			'			"name_details": \'brief description\',\n'
			'			"status": "int",\n'
			'			"doing": "old",\n'
			'			"lastupdate": "2013/04/05 06:07:08",\n'
			'			"lastExecution": "19000101-000000",\n'
			'		},\n'
			'		{\n'
			'			"name": "yourclient",\n'
			'			"description": \'your description\',\n'
			'			"name_details": \'your brief description\',\n'
			'			"status": "int",\n'
			'			"doing": "old",\n'
			'			"lastupdate": "2013/04/05 06:07:08",\n'
			'			"lastExecution": "19000101-000000",\n'
			'		},\n'
			'	]\n'
			'}'
			)
开发者ID:clam-project,项目名称:testfarm-server2,代码行数:52,代码来源:webgenerator_test.py

示例4: test_clientMetadata_updates

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import setClientMetadata [as 别名]
	def test_clientMetadata_updates(self) :
		s = Server("fixture")
		s.createServer()
		s.createProject("myproject")
		s.createClient("myproject","myclient")
		s.setClientMetadata("myproject", "myclient",
			key1 = "first",
			key2 = [4,3,2],
			)
		s.setClientMetadata("myproject", "myclient",
			key1 = "second",
			key3 = [7,8,9],
			)
		self.assertEqual(s.clientMetadata("myproject","myclient"),
			{'key1': 'second', 'key2' : [4,3,2], 'key3' : [7,8,9]})
开发者ID:clam-project,项目名称:testfarm-server2,代码行数:17,代码来源:server_test.py

示例5: setUpClient

# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import setClientMetadata [as 别名]
	def setUpClient(self, client) :
		s = Server("fixture")
		s.createClient("myproject", client)
		s.setClientMetadata("myproject", client, 
			briefDescription = "brief description",
			)
开发者ID:clam-project,项目名称:testfarm-server2,代码行数:8,代码来源:webgenerator_test.py


注:本文中的server.Server.setClientMetadata方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。