def test_clear_markings(data): before = data[0] after = data[1] before = markings.clear_markings(before, None) assert 'object_marking_refs' not in before assert 'object_marking_refs' not in after
def test_clear_marking_not_present(data): """Test clearing markings for a selector that has no associated markings.""" with pytest.raises(MarkingNotFoundError): data = markings.clear_markings(data, ["labels"])
def test_clear_marking_bad_selector(data, selector): """Test bad selector raises exception.""" with pytest.raises(InvalidSelectorError): markings.clear_markings(data, selector)
def test_clear_marking_all_selectors(data): data = markings.clear_markings(data, ["description", "type", "modified"]) assert markings.is_marked(data, "description") is False assert "granular_markings" not in data
def test_clear_marking_one_selector(data): """Test markings associated with one selector were removed.""" data = markings.clear_markings(data, "description") assert markings.is_marked(data, "description") is False
def test_clear_marking_multiple_selectors(data): """Test clearing markings for multiple selectors effectively removes associated markings.""" data = markings.clear_markings(data, ["type", "description"]) assert markings.is_marked(data, ["type", "description"]) is False
def test_clear_marking_smoke(data): """Test clear_marking call does not fail.""" data = markings.clear_markings(data, "modified") assert markings.is_marked(data, "modified") is False