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


Python Mock.mock_put方法代码示例

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

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

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

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

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

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

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


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