def test_add_probability_filter_passed_no_nodes_metric(datadog_noop_scenario):
    """
    Ensures that add_probability_filter_passed_no_nodes_metric is called when
    the filter decides to pass no nodes based on a probability
    """
    assert datadog_noop_scenario.name == "test scenario"
    random.seed(6)  # make the tests deterministic
    candidates = [make_dummy_object()]

    with mock.patch('powerfulseal.metriccollectors.DatadogCollector.add_probability_filter_passed_no_nodes_filter') \
            as metric_function:
        # Ensure metric is not added when nodes are all passed
        criterion = {"probabilityPassAll": 1}
        datadog_noop_scenario.filter_probability(candidates, criterion)
        metric_function.assert_not_called()

        # Ensure metric is added when nodes are not passed
        criterion = {"probabilityPassAll": 0.00000001}
        datadog_noop_scenario.filter_probability(candidates, criterion)
        metric_function.assert_called()

    Ensures that add_probability_filter_passed_no_nodes_metric is called when
    the filter decides to pass no nodes based on a probability
    
tests/metriccollectors/test_datadog_collector.py