Skip to content

Commit

Permalink
Mapped Collection delete_protected implies v1.8.0
Browse files Browse the repository at this point in the history
Fix the omission from DATATYPE_VERSION_IMPLICATIONS and add tests.
  • Loading branch information
sirosen committed Dec 12, 2023
1 parent e83120e commit 99035ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/globus_sdk/services/gcs/data/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class CollectionDocument(utils.PayloadWrapper, abc.ABC):

DATATYPE_BASE: str = "collection"
DATATYPE_VERSION_IMPLICATIONS: dict[str, tuple[int, int, int]] = {
"delete_protected": (1, 8, 0),
"guest_auth_policy_id": (1, 6, 0),
"disable_anonymous_writes": (1, 5, 0),
"force_verify": (1, 4, 0),
Expand Down
11 changes: 11 additions & 0 deletions tests/unit/helpers/gcs/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ def test_datatype_version_deduction(use_kwargs, doc_version):
({"disable_anonymous_writes": True}, "1.5.0"),
({"disable_anonymous_writes": False}, "1.5.0"),
({"guest_auth_policy_id": str(uuid.uuid4())}, "1.6.0"),
({"delete_protected": False}, "1.8.0"),
# combining a long user_message (which uses callback-based detection) with
# higher and lower bounding fields needs to apply correctly
(
{"force_verify": False, "user_message": "long message..." + "x" * 100},
"1.7.0",
),
(
{"delete_protected": False, "user_message": "long message..." + "x" * 100},
"1.8.0",
),
],
)
def test_datatype_version_deduction_mapped_specific_fields(use_kwargs, doc_version):
Expand Down

0 comments on commit 99035ca

Please sign in to comment.