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


Python Mock.mock_server_operation方法代码示例

本文整理汇总了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'
开发者ID:andersinno,项目名称:upcloud-python-api,代码行数:12,代码来源:test_server.py

示例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"
开发者ID:derega,项目名称:upcloud-python-api,代码行数:12,代码来源:test_server.py

示例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'
开发者ID:andersinno,项目名称:upcloud-python-api,代码行数:12,代码来源:test_server.py

示例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"
开发者ID:derega,项目名称:upcloud-python-api,代码行数:12,代码来源:test_server.py


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