def METHOD_NAME(aggregator, check):
    # instance with defaults
    instance = {"name": "ok_instance"}
    name, host, port, custom_tags = check.parse_instance(instance)
    assert name == "ok_instance"
    assert host == "localhost"
    assert port == 3128
    assert custom_tags == []
    # instance with no defaults
    instance = {
        "name": "ok_instance",
        "host": "host",
        "port": 1234,
        "cachemgr_username": "datadog",
        "cachemgr_password": "pass",
        "tags": ["foo:bar"],
    }
    name, host, port, custom_tags = check.parse_instance(instance)
    assert name == "ok_instance"
    assert host == "host"
    assert port == 1234
    assert custom_tags == ["foo:bar"]
    # instance with no name
    instance = {"host": "host"}
    with pytest.raises(Exception):
        check.parse_instance(instance)