本文整理汇总了Python中conftest.Mock.mock_put方法的典型用法代码示例。如果您正苦于以下问题:Python Mock.mock_put方法的具体用法?Python Mock.mock_put怎么用?Python Mock.mock_put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类conftest.Mock
的用法示例。
在下文中一共展示了Mock.mock_put方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_storage_update
# 需要导入模块: from conftest import Mock [as 别名]
# 或者: from conftest.Mock import mock_put [as 别名]
def test_storage_update(self, manager):
Mock.mock_put("storage/01d4fcd4-e446-433b-8a9c-551a1284952e")
storage = manager.modify_storage("01d4fcd4-e446-433b-8a9c-551a1284952e", title="my bigger data collection", size=15)
assert type(storage).__name__ == "Storage"
assert storage.size == 15
assert storage.title == "my bigger data collection"
示例2: test_storage_update_oop
# 需要导入模块: from conftest import Mock [as 别名]
# 或者: from conftest.Mock import mock_put [as 别名]
def test_storage_update_oop(self, manager):
data = Mock.mock_get("storage/01d4fcd4-e446-433b-8a9c-551a1284952e")
storage = manager.get_storage("01d4fcd4-e446-433b-8a9c-551a1284952e")
Mock.mock_put("storage/01d4fcd4-e446-433b-8a9c-551a1284952e")
storage.update(title="my bigger data collection", size=15)
assert storage.title == "my bigger data collection"
assert storage.size == 15
示例3: test_modify_ip_oop
# 需要导入模块: from conftest import Mock [as 别名]
# 或者: from conftest.Mock import mock_put [as 别名]
def test_modify_ip_oop(self, manager):
# get ip
data = Mock.mock_get('ip_address/10.1.0.101')
ip_addr = manager.get_IP('10.1.0.101')
# put ip
data = Mock.mock_put('ip_address/10.1.0.101')
ip_addr.ptr = 'my.ptr.record'
ip_addr.save()
assert ip_addr.ptr == 'my.ptr.record'
示例4: test_modify_ip_oop
# 需要导入模块: from conftest import Mock [as 别名]
# 或者: from conftest.Mock import mock_put [as 别名]
def test_modify_ip_oop(self, manager):
# get ip
data = Mock.mock_get("ip_address/10.1.0.101")
ip_addr = manager.get_IP("10.1.0.101")
# put ip
data = Mock.mock_put("ip_address/10.1.0.101")
ip_addr.ptr = "my.ptr.record"
ip_addr.save()
assert ip_addr.ptr == "my.ptr.record"
示例5: test_update_server_oop
# 需要导入模块: from conftest import Mock [as 别名]
# 或者: from conftest.Mock import mock_put [as 别名]
def test_update_server_oop(self, manager):
data = Mock.mock_get('server/00798b85-efdc-41ca-8021-f6ef457b8531')
server = manager.get_server('00798b85-efdc-41ca-8021-f6ef457b8531')
server.core_number = 6
server.memory_amount = 1024
server.title = 'Updated server'
data = Mock.mock_put('server/00798b85-efdc-41ca-8021-f6ef457b8531')
server.save()
assert server.core_number == 6
assert server.memory_amount == 1024
assert server.title == 'Updated server'
示例6: test_modify_ip
# 需要导入模块: from conftest import Mock [as 别名]
# 或者: from conftest.Mock import mock_put [as 别名]
def test_modify_ip(self, manager):
data = Mock.mock_put('ip_address/10.1.0.101')
ip_addr = manager.modify_IP('10.1.0.101', ptr_record='my.ptr.record')
assert ip_addr.ptr == 'my.ptr.record'
示例7: test_modify_ip
# 需要导入模块: from conftest import Mock [as 别名]
# 或者: from conftest.Mock import mock_put [as 别名]
def test_modify_ip(self, manager):
data = Mock.mock_put("ip_address/10.1.0.101")
ip_addr = manager.modify_IP("10.1.0.101", ptr_record="my.ptr.record")
assert ip_addr.ptr == "my.ptr.record"