def test_basic_check(aggregator):
    """
    Returns the right metrics and service checks
    """
    # Set up & run the check
    config = {'instances': [INSTANCE]}
    initialize_pdh_tests()
    c = PDHCheck(CHECK_NAME, {}, config['instances'])
    c.check(config['instances'][0])

    for metric in INSTANCE_METRICS:
        aggregator.assert_metric(metric, tags=None, count=1)

    aggregator.assert_all_metrics_covered()
def test_raises_configuration_error():
    with pytest.raises(ConfigurationError):
        PDHCheck(CHECK_NAME, {}, [{}])
def test_raises_configuration_error(dd_run_check):
    with pytest.raises(ConfigurationError):
        check = PDHCheck(CHECK_NAME, {}, [{}])
        dd_run_check(check)