Ejemplo n.º 1
0
def FakePool():
    fake_ltm_instance = mock.MagicMock()
    fake_ltm_instance.bigip.icr_uri = 'https://0.0.0.0/mgmt/tm/'
    fake_pool = Pool(fake_ltm_instance)
    fake_pool._del_arp_and_fdb = mock.MagicMock()
    fake_pool._get_items = mock.MagicMock()
    return fake_pool
Ejemplo n.º 2
0
def FakePool():
    fake_ltm_instance = mock.MagicMock()
    fake_ltm_instance.bigip.icr_uri = 'https://0.0.0.0/mgmt/tm/'
    fake_pool = Pool(fake_ltm_instance)
    fake_pool._del_arp_and_fdb = mock.MagicMock()
    fake_pool._get_items = mock.MagicMock()
    return fake_pool
Ejemplo n.º 3
0
def itest_get_load_balancing():
    response = BigIPMock.create_mock_response(
        200, BigIPMock.read_json_file(JSON_FILE))

    big_ip = BigIPMock(response)
    test_pool = Pool(big_ip)

    mode = test_pool.get_lb_method("my-Pool")
    assert mode == "ROUND_ROBIN"
Ejemplo n.º 4
0
def itest_get_description():
    response = BigIPMock.create_mock_response(
        200, BigIPMock.read_json_file(JSON_FILE))

    big_ip = BigIPMock(response)
    test_pool = Pool(big_ip)

    description = test_pool.get_description("my-Pool")
    assert description == "sdfds"
Ejemplo n.º 5
0
def itest_get_load_balancing():
    response = BigIPMock.create_mock_response(
        200, BigIPMock.read_json_file(JSON_FILE))

    big_ip = BigIPMock(response)
    test_pool = Pool(big_ip)

    mode = test_pool.get_lb_method("my-Pool")
    assert mode == "ROUND_ROBIN"
Ejemplo n.º 6
0
def itest_get_description():
    response = BigIPMock.create_mock_response(
        200, BigIPMock.read_json_file(JSON_FILE))

    big_ip = BigIPMock(response)
    test_pool = Pool(big_ip)

    description = test_pool.get_description("my-Pool")
    assert description == "sdfds"
Ejemplo n.º 7
0
def itest_get_description_error():
    response = BigIPMock.create_mock_response(
        500, BigIPMock.read_json_file(JSON_FILE))

    big_ip = BigIPMock(response)
    test_pool = Pool(big_ip)

    # should raise a PoolQueryException
    with pytest.raises(exceptions.PoolQueryException):
        test_pool.get_description("my-Pool")
Ejemplo n.º 8
0
def itest_get_description_error():
    response = BigIPMock.create_mock_response(
        500, BigIPMock.read_json_file(JSON_FILE))

    big_ip = BigIPMock(response)
    test_pool = Pool(big_ip)

    # should raise a PoolQueryException
    with pytest.raises(exceptions.PoolQueryException):
        test_pool.get_description("my-Pool")