|
44 | 44 | from tests.integration.requests_test import delete_token
|
45 | 45 |
|
46 | 46 | CLASSIFICATION_NAME = "Issue"
|
| 47 | +CLASSIFICATION_NAME_2 = "Confidential" |
47 | 48 | SL_SORT_BY_TIMESTAMP = SortItem(field="timestamp", order=SortOrder.ASCENDING)
|
48 | 49 | SL_SORT_BY_GUID = SortItem(field="entityGuidsAll", order=SortOrder.ASCENDING)
|
49 | 50 | SL_SORT_BY_QUALIFIED_NAME = SortItem(
|
@@ -821,6 +822,38 @@ def test_remove_classification(client: AtlanClient, term1: AtlasGlossaryTerm):
|
821 | 822 | assert not glossary_term.atlan_tags
|
822 | 823 |
|
823 | 824 |
|
| 825 | +def test_multiple_add_classification(client: AtlanClient, term1: AtlasGlossaryTerm): |
| 826 | + assert term1.qualified_name |
| 827 | + client.asset.add_atlan_tags( |
| 828 | + AtlasGlossaryTerm, |
| 829 | + term1.qualified_name, |
| 830 | + [CLASSIFICATION_NAME, CLASSIFICATION_NAME_2], |
| 831 | + ) |
| 832 | + glossary_term = client.asset.get_by_guid( |
| 833 | + term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False |
| 834 | + ) |
| 835 | + assert glossary_term.atlan_tags |
| 836 | + assert len(glossary_term.atlan_tags) == 2 |
| 837 | + classification = glossary_term.atlan_tags[0] |
| 838 | + assert str(classification.type_name) == CLASSIFICATION_NAME_2 |
| 839 | + classification_2 = glossary_term.atlan_tags[1] |
| 840 | + assert str(classification_2.type_name) == CLASSIFICATION_NAME |
| 841 | + |
| 842 | + |
| 843 | +@pytest.mark.order(after="test_multiple_add_classification") |
| 844 | +def test_multiple_remove_classification(client: AtlanClient, term1: AtlasGlossaryTerm): |
| 845 | + assert term1.qualified_name |
| 846 | + client.asset.remove_atlan_tags( |
| 847 | + AtlasGlossaryTerm, |
| 848 | + term1.qualified_name, |
| 849 | + [CLASSIFICATION_NAME, CLASSIFICATION_NAME_2], |
| 850 | + ) |
| 851 | + glossary_term = client.asset.get_by_guid( |
| 852 | + term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False |
| 853 | + ) |
| 854 | + assert not glossary_term.atlan_tags |
| 855 | + |
| 856 | + |
824 | 857 | def test_glossary_update_certificate(client: AtlanClient, glossary: AtlasGlossary):
|
825 | 858 | _test_update_certificate(client, glossary, AtlasGlossary)
|
826 | 859 |
|
|
0 commit comments