test_server.py 文件源码

python
阅读 39 收藏 0 点赞 0 评论 0

项目:ucsmsdk_samples 作者: CiscoUcs 项目源码 文件源码
def test_valid_server_pool_add_slot(query_mock, add_mo_mock, commit_mock):
    query_mock.return_value = ComputePool(parent_mo_or_dn="org-root",
                                          name="test-pool")
    add_mo_mock.return_value = True
    commit_mock.return_value = True
    handle = UcsHandle('169.254.1.1', 'admin', 'password')

    # Scenario: Default parameters
    pool_retval = server_pool_add_slot(handle, 1, 8)
    # Verify we were passed back the correct object type
    assert isinstance(pool_retval, ComputePooledSlot)
    # Verify the ID we gave it was assigned correctly
    assert pool_retval.chassis_id == str(1)
    assert pool_retval.slot_id == str(8)


# Patch UcsHandle.commit to simulate ucsm interaction w/o real ucsm
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号