本文整理汇总了Python中server.Server.createClient方法的典型用法代码示例。如果您正苦于以下问题:Python Server.createClient方法的具体用法?Python Server.createClient怎么用?Python Server.createClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类server.Server
的用法示例。
在下文中一共展示了Server.createClient方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUpExecution
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import createClient [as 别名]
def setUpExecution(self, server, project, client, execution) :
s = Server(server)
s.createServer()
s.createProject(project)
s.createClient(project, client)
e = ArgPrepender(s, project, client, execution)
return e
示例2: test_clientStatus_whenStarted
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import createClient [as 别名]
def test_clientStatus_whenStarted(self) :
s = Server("fixture")
s.createServer()
s.createProject("myproject")
s.createClient("myproject", "myclient")
self.assertEqual(
s.clientStatus("myproject","myclient"), "NotResponding")
示例3: test_isRunning_withClient_noExecutions
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import createClient [as 别名]
def test_isRunning_withClient_noExecutions(self) :
s = Server("fixture")
s.createServer()
s.createProject("myproject")
s.createClient("myproject", "myclient")
self.assertEqual(
s.isRunning("myproject","myclient"), False)
示例4: test_clientStatus_afterIdle
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import createClient [as 别名]
def test_clientStatus_afterIdle(self) :
s = Server("fixture")
s.createServer()
s.createProject("myproject")
s.createClient("myproject", "myclient")
s.clientIdle("myproject", "myclient", 30)
self.assertEqual(
s.clientStatus("myproject","myclient"), "Idle")
示例5: test_assertClientOk_whenAllOk
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import createClient [as 别名]
def test_assertClientOk_whenAllOk(self) :
s = Server("fixture")
s.createServer()
s.createProject("myproject")
s.createClient("myproject", "myclient")
s._assertClientOk("myproject","myclient")
# no exceptiona
self.assertFileContent("fixture/myproject/myclient/metadata",
"{}")
示例6: setUpEmptyClient
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import createClient [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
示例7: test_clientMetadata
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import createClient [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]})
示例8: test_clients
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import createClient [as 别名]
def test_clients(self) :
s = Server("fixture")
s.createServer()
s.createProject("project1")
s.createClient("project1","client1-1")
s.createProject("project2")
s.createClient("project2","client2-1")
s.createClient("project2","client2-2")
self.assertEqual(s.clients("project2"), [
'client2-1',
'client2-2',
])
示例9: test_isRunning_withExecution
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import createClient [as 别名]
def test_isRunning_withExecution(self) :
s = Server("fixture")
s.createServer()
s.createProject("myproject")
s.createClient("myproject", "myclient")
s.executionStarts(
"myproject", "myclient", "20130301-132313",
timestamp="2013-03-01 13:23:13",
changelog=[])
self.assertEqual(
s.isRunning("myproject","myclient","20130301-132313"), True)
示例10: test_clientStatus_whenRunning
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import createClient [as 别名]
def test_clientStatus_whenRunning(self) :
s = Server("fixture")
s.createServer()
s.createProject("myproject")
s.createClient("myproject", "myclient")
s.executionStarts(
"myproject", "myclient", "20130301-132313",
timestamp="2013-03-01 13:23:13",
changelog=[])
self.assertEqual(
s.clientStatus("myproject","myclient"), "Running")
示例11: test_project_withClients
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import createClient [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'
'}'
)
示例12: test_clientMetadata_updates
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import createClient [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]})
示例13: emptyExecution
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import createClient [as 别名]
def emptyExecution(self) :
project, client, execution = "myproject", "myclient", "20130301-232425"
s = Server("fixture")
s.createServer()
s.createProject(project)
s.createClient(project, client)
# force an idle time
s.now=datetime.datetime(2013,4,5,6,7,8)
s.clientIdle("myproject", "myclient", 0)
e = ArgPrepender(s, project, client, execution)
e.executionStarts(
timestamp="2013-03-01 23:24:25",
changelog=[])
e.executionEnds(True)
return e.execution()
示例14: test_executions
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import createClient [as 别名]
def test_executions(self) :
s = Server('fixture')
s.createServer()
s.createProject("myproject")
s.createClient("myproject","myclient")
s.executionStarts("myproject", "myclient", "20130301-225341",
timestamp="2013-03-01 22:53:41",
changelog=[],
)
s.executionStarts("myproject", "myclient", "20130302-101313",
timestamp="2013-03-02 10:13:13",
changelog=[],
)
self.assertEqual(s.executions("myproject","myclient"), [
'20130301-225341',
'20130302-101313',
])
示例15: executionFixture
# 需要导入模块: from server import Server [as 别名]
# 或者: from server.Server import createClient [as 别名]
def executionFixture(self, running = False) :
project, client, execution = "myproject", "myclient", "20130301-232425"
s = Server("fixture")
s.createServer()
s.createProject(project)
s.createClient(project, client)
# force an idle time
s.now=datetime.datetime(2013,4,5,6,7,8)
s.clientIdle(project,client, 0)
e = ArgPrepender(s, project, client, execution)
e.executionStarts(
timestamp="2013-03-01 23:24:25",
changelog=[])
e.taskStarts(1, "First task")
e.commandStarts(1,1, "command line")
if running : return e.execution()
e.commandEnds(1,1, output="output", ok=True, info=None, stats={})
e.taskEnds(1,True)
e.executionEnds(True)
return e.execution()