本文整理汇总了Python中conftest.Mock.mock_server_operation方法的典型用法代码示例。如果您正苦于以下问题:Python Mock.mock_server_operation方法的具体用法?Python Mock.mock_server_operation怎么用?Python Mock.mock_server_operation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类conftest.Mock
的用法示例。
在下文中一共展示了Mock.mock_server_operation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_restart_server
# 需要导入模块: from conftest import Mock [as 别名]
# 或者: from conftest.Mock import mock_server_operation [as 别名]
def test_restart_server(self, manager):
data = Mock.mock_get('server/00798b85-efdc-41ca-8021-f6ef457b8531')
server = manager.get_server('00798b85-efdc-41ca-8021-f6ef457b8531')
assert server.state == 'started'
data = Mock.mock_server_operation('server/00798b85-efdc-41ca-8021-f6ef457b8531/restart')
server.restart()
assert server.state == 'maintenance'
示例2: test_restart_server
# 需要导入模块: from conftest import Mock [as 别名]
# 或者: from conftest.Mock import mock_server_operation [as 别名]
def test_restart_server(self, manager):
data = Mock.mock_get("server/00798b85-efdc-41ca-8021-f6ef457b8531")
server = manager.get_server("00798b85-efdc-41ca-8021-f6ef457b8531")
assert server.state == "started"
data = Mock.mock_server_operation("server/00798b85-efdc-41ca-8021-f6ef457b8531/restart")
server.restart()
assert server.state == "maintenance"
示例3: test_start_server
# 需要导入模块: from conftest import Mock [as 别名]
# 或者: from conftest.Mock import mock_server_operation [as 别名]
def test_start_server(self, manager):
data = Mock.mock_get('server/009d64ef-31d1-4684-a26b-c86c955cbf46')
server = manager.get_server('009d64ef-31d1-4684-a26b-c86c955cbf46')
assert server.state == 'stopped'
data = Mock.mock_server_operation('server/009d64ef-31d1-4684-a26b-c86c955cbf46/start')
server.start()
assert server.state == 'started'
示例4: test_start_server
# 需要导入模块: from conftest import Mock [as 别名]
# 或者: from conftest.Mock import mock_server_operation [as 别名]
def test_start_server(self, manager):
data = Mock.mock_get("server/009d64ef-31d1-4684-a26b-c86c955cbf46")
server = manager.get_server("009d64ef-31d1-4684-a26b-c86c955cbf46")
assert server.state == "stopped"
data = Mock.mock_server_operation("server/009d64ef-31d1-4684-a26b-c86c955cbf46/start")
server.start()
assert server.state == "started"