Skip to content

Commit 83de13f

Browse files
GOV-778: Add integration tests
1 parent 302feee commit 83de13f

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

tests/integration/custom_metadata_test.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,30 @@ def test_cm_raci(
340340
assert not one.options.multi_value_select
341341

342342

343+
@pytest.mark.order(after="test_cm_raci")
344+
def test_show_as_featured_survives_update(
345+
client: AtlanClient, cm_raci: CustomMetadataDef
346+
):
347+
existing = client.custom_metadata_cache.get_custom_metadata_def(name=CM_RACI)
348+
assert existing.attribute_defs
349+
attr = existing.attribute_defs[0]
350+
assert attr.options
351+
attr.options.show_as_featured = True
352+
assert existing.options
353+
existing.options.is_locked = True
354+
response = client.typedef.update(existing)
355+
assert response
356+
assert len(response.custom_metadata_defs) == 1
357+
updated = response.custom_metadata_defs[0]
358+
assert updated.attribute_defs
359+
updated_attr = updated.attribute_defs[0]
360+
assert updated_attr.options
361+
assert updated_attr.options.show_as_featured is True
362+
assert updated.options
363+
updated.options.is_locked = False
364+
client.typedef.update(updated)
365+
366+
343367
@pytest.fixture(scope="module")
344368
def cm_enum(
345369
client: AtlanClient,

tests_v9/integration/custom_metadata_test.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,30 @@ def test_cm_raci(
340340
assert not one.options.multi_value_select
341341

342342

343+
@pytest.mark.order(after="test_cm_raci")
344+
def test_show_as_featured_survives_update(
345+
client: AtlanClient, cm_raci: CustomMetadataDef
346+
):
347+
existing = client.custom_metadata_cache.get_custom_metadata_def(name=CM_RACI)
348+
assert existing.attribute_defs
349+
attr = existing.attribute_defs[0]
350+
assert attr.options
351+
attr.options.show_as_featured = True
352+
assert existing.options
353+
existing.options.is_locked = True
354+
response = client.typedef.updater(existing)
355+
assert response
356+
assert len(response.custom_metadata_defs) == 1
357+
updated = response.custom_metadata_defs[0]
358+
assert updated.attribute_defs
359+
updated_attr = updated.attribute_defs[0]
360+
assert updated_attr.options
361+
assert updated_attr.options.show_as_featured is True
362+
assert updated.options
363+
updated.options.is_locked = False
364+
client.typedef.updater(updated)
365+
366+
343367
@pytest.fixture(scope="module")
344368
def cm_enum(
345369
client: AtlanClient,

0 commit comments

Comments
 (0)