コード例 #1
0
ファイル: test_webapi.py プロジェクト: surajrb/checkmk
def test_get_host_effective_attributes(web):
    try:
        web.add_host("test-host", attributes={
            "ipaddress": "127.0.0.1",
        })

        host = web.get_host("test-host", effective_attributes=False)
        assert "tag_networking" not in host["attributes"]

        host = web.get_host("test-host", effective_attributes=True)
        assert "tag_networking" in host["attributes"]
        assert host["attributes"]["tag_networking"] == "lan"
    finally:
        web.delete_host("test-host")
コード例 #2
0
ファイル: test_webapi.py プロジェクト: selten/checkmk
def test_get_host_effective_attributes(web):  # noqa: F811 # pylint: disable=redefined-outer-name
    try:
        web.add_host("test-host", attributes={
            "ipaddress": "127.0.0.1",
        })

        host = web.get_host("test-host", effective_attributes=False)
        assert "tag_networking" not in host["attributes"]

        host = web.get_host("test-host", effective_attributes=True)
        assert "tag_networking" in host["attributes"]
        assert host["attributes"]["tag_networking"] == "lan"
    finally:
        web.delete_host("test-host")