generated from coulomb/repo-seed
Warnings cleanup
This commit is contained in:
@@ -366,6 +366,54 @@ def test_cmis_browser_binding_delete_content_stream_tombstones_content(cmis_clie
|
||||
assert content_after_delete.json()["exception"] == "constraint"
|
||||
|
||||
|
||||
def test_cmis_browser_binding_append_content_stream_adds_versioned_content(cmis_client) -> None:
|
||||
document = cmis_client.post(
|
||||
"/cmis/compat-tck/browser/root",
|
||||
data={
|
||||
"cmisaction": "createDocument",
|
||||
"propertyId[0]": "cmis:objectTypeId",
|
||||
"propertyValue[0]": "cmis:document",
|
||||
"propertyId[1]": "cmis:name",
|
||||
"propertyValue[1]": "Append Content Document",
|
||||
},
|
||||
files={"content": ("append-content.txt", b"one", "text/plain")},
|
||||
).json()
|
||||
object_id = document["properties"]["cmis:objectId"]["value"]
|
||||
token = document["properties"]["cmis:changeToken"]["value"]
|
||||
|
||||
appended = cmis_client.post(
|
||||
"/cmis/compat-tck/browser/root",
|
||||
data={
|
||||
"cmisaction": "appendContent",
|
||||
"objectId": object_id,
|
||||
"changeToken": token,
|
||||
"isLastChunk": "true",
|
||||
},
|
||||
files={"content": ("append-content.txt", b" two", "text/plain")},
|
||||
)
|
||||
content = cmis_client.get(
|
||||
"/cmis/compat-tck/browser/root",
|
||||
params={"cmisselector": "content", "objectId": object_id},
|
||||
)
|
||||
stale_append = cmis_client.post(
|
||||
"/cmis/compat-tck/browser/root",
|
||||
data={
|
||||
"cmisaction": "appendContentStream",
|
||||
"objectId": object_id,
|
||||
"changeToken": token,
|
||||
},
|
||||
files={"content": ("append-content.txt", b" stale", "text/plain")},
|
||||
)
|
||||
|
||||
assert appended.status_code == 200
|
||||
assert appended.json()["properties"]["cmis:contentStreamLength"]["value"] == 7
|
||||
assert appended.json()["properties"]["cmis:contentStreamMimeType"]["value"] == "text/plain"
|
||||
assert appended.json()["properties"]["cmis:changeToken"]["value"] != token
|
||||
assert content.content == b"one two"
|
||||
assert stale_append.status_code == 409
|
||||
assert stale_append.json()["exception"] == "updateConflict"
|
||||
|
||||
|
||||
def test_cmis_browser_binding_change_tokens_conflict_on_stale_updates(cmis_client) -> None:
|
||||
document = cmis_client.post(
|
||||
"/cmis/compat-tck/browser/root",
|
||||
|
||||
@@ -80,6 +80,7 @@ def test_profile_visibility_and_mutation_expectations_are_explicit() -> None:
|
||||
"update_properties",
|
||||
"delete_object",
|
||||
"set_content_stream",
|
||||
"append_content_stream",
|
||||
]
|
||||
else:
|
||||
assert expectations["must_reject_actions"] == [
|
||||
@@ -87,6 +88,7 @@ def test_profile_visibility_and_mutation_expectations_are_explicit() -> None:
|
||||
"update_properties",
|
||||
"delete_object",
|
||||
"set_content_stream",
|
||||
"append_content_stream",
|
||||
]
|
||||
|
||||
|
||||
@@ -117,4 +119,3 @@ def test_admin_export_is_the_only_profile_for_deferred_extension_group() -> None
|
||||
for profile_name, expectations in catalog["profile_expectations"].items():
|
||||
exposes_extension = "retention-renditions-bulk" in expectations["must_expose"]
|
||||
assert exposes_extension is (profile_name == "admin-export")
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ ACTION_MAP = {
|
||||
"update_properties": CMISAction.UPDATE_PROPERTIES,
|
||||
"delete_object": CMISAction.DELETE_OBJECT,
|
||||
"set_content_stream": CMISAction.SET_CONTENT_STREAM,
|
||||
"append_content_stream": CMISAction.SET_CONTENT_STREAM,
|
||||
}
|
||||
|
||||
|
||||
@@ -119,4 +120,3 @@ def test_optional_tck_result_template_can_capture_gap_mapping() -> None:
|
||||
assert template["summary"] == {"passed": 0, "failed": 0, "skipped": 0, "known_gap": 0}
|
||||
assert "capability_gaps" in template
|
||||
assert template["groups"][0]["status"] == "not_run"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user