Example #1
0
    def test_device_router_get_info_by_uid_not_found(self, responses):
        responses_callback(responses)

        dr = DeviceRouter(url, headers, True)
        with pytest.raises(
                ZenossAPIClientError,
                message=
                "Request failed: ObjectNotFoundException: Cannot find \"Devices/Server/TEST\". KeyError: 'TEST'"
        ):
            resp = dr._get_info_by_uid('Devices/Server/NOTFOUND')
Example #2
0
    def test_device_router_get_info_by_uid(self, responses):
        responses_callback(responses)

        dr = DeviceRouter(url, headers, True)
        resp = dr._get_info_by_uid('Devices/Server/TEST')
        assert resp['data']['name'] == "TEST"