def test_describe_with_ipaddress_and_credentials(monkeypatch):
    hostname = "testhost"
    Scenario().add_host(hostname).apply(monkeypatch)
    source = IPMIManagementBoardDataSource(hostname, "127.0.0.1")
    source._credentials = {"username": "******"}

    assert source.describe() == "Management board - IPMI (Address: 127.0.0.1, User: Bobby)"
Example #2
0
def test_describe_with_credentials(monkeypatch):
    hostname = "testhost"
    Scenario().add_host(hostname).apply(monkeypatch)
    source = IPMIManagementBoardDataSource(hostname, None)
    source._credentials = {"username": "******"}

    assert source.describe() == "Management board - IPMI (User: Bobby)"
Example #3
0
def test_describe_with_ipaddress(monkeypatch):
    hostname = "testhost"
    Scenario().add_host(hostname).apply(monkeypatch)
    source = IPMIManagementBoardDataSource(hostname, None)
    source._ipaddress = "127.0.0.1"  # The API is lying.

    assert source.describe() == "Management board - IPMI (Address: 127.0.0.1)"