def test_remove_pivots(_create_pivot_ns): """Test remove pivots function.""" piv_attrs = _get_piv_attrs(entities.Host) check.is_true(piv_attrs) with pytest.raises(ValueError): Pivot.remove_pivot_funcs(entity="TestEntity") piv_attrs = _get_piv_attrs(entities.Host) check.is_true(piv_attrs) Pivot.remove_pivot_funcs(entity="Host") piv_attrs = _get_piv_attrs(entities.Host) check.is_false(piv_attrs) piv_attrs = _get_piv_attrs(entities.IpAddress) check.is_true(piv_attrs) Pivot.remove_pivot_funcs(entity="all") piv_attrs = _get_piv_attrs(entities.IpAddress) check.is_false(piv_attrs)
def _reset_entities(): """Clear any query containers in entities.""" Pivot.remove_pivot_funcs(entity="all")