本文整理汇总了Python中conftest.Mock.mock_post方法的典型用法代码示例。如果您正苦于以下问题:Python Mock.mock_post方法的具体用法?Python Mock.mock_post怎么用?Python Mock.mock_post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类conftest.Mock
的用法示例。
在下文中一共展示了Mock.mock_post方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_storage_create
# 需要导入模块: from conftest import Mock [as 别名]
# 或者: from conftest.Mock import mock_post [as 别名]
def test_storage_create(self, manager):
Mock.mock_post("storage")
storage = manager.create_storage(666, "maxiops", "My data collection", "fi-hel1")
assert type(storage).__name__ == "Storage"
assert storage.size == 666
assert storage.tier == "maxiops"
assert storage.title == "My data collection"
assert storage.zone == "fi-hel1"
示例2: test_attach_and_detach_IP
# 需要导入模块: from conftest import Mock [as 别名]
# 或者: from conftest.Mock import mock_post [as 别名]
def test_attach_and_detach_IP(self, manager):
data = Mock.mock_get('server/00798b85-efdc-41ca-8021-f6ef457b8531')
server = manager.get_server('00798b85-efdc-41ca-8021-f6ef457b8531')
assert len(server.ip_addresses) == 2
data = Mock.mock_post('ip_address')
server.add_IP()
assert len(server.ip_addresses) == 3
Mock.mock_delete('ip_address/'+server.ip_addresses[2].address)
server.remove_IP(server.ip_addresses[2])
assert len(server.ip_addresses) == 2