@@ -84,10 +84,11 @@ def test_search_with_original_response(client: Client):
8484
8585
8686def test_collection (client : Client ):
87+
8788 docs = client .documents .search (
8889 categories = ["content" , "collections" ], collections = ["search-test" ]
8990 )
90- assert len (docs ) == 2
91+ assert len (docs ) == 4
9192
9293 doc1 = next (doc for doc in docs if doc .uri == "/doc1.json" )
9394 assert doc1 .content is not None
@@ -101,6 +102,18 @@ def test_collection(client: Client):
101102 assert "test-data" in doc1 .collections
102103 assert "search-test" in doc1 .collections
103104
105+ doc3 = next (doc for doc in docs if doc .uri == "/doc2;copy.xml" )
106+ assert doc3 .content is not None
107+ assert len (doc3 .collections ) == 2
108+ assert "test-data" in doc3 .collections
109+ assert "search-test" in doc3 .collections
110+
111+ doc4 = next (doc for doc in docs if doc .uri == "/doc2=copy.xml" )
112+ assert doc4 .content is not None
113+ assert len (doc4 .collections ) == 2
114+ assert "test-data" in doc4 .collections
115+ assert "search-test" in doc4 .collections
116+
104117
105118def test_not_rest_user (not_rest_user_client : Client ):
106119 response : Response = not_rest_user_client .documents .search (q = "hello" )
@@ -109,3 +122,27 @@ def test_not_rest_user(not_rest_user_client: Client):
109122 ), """The user does not have the rest-reader privilege, so MarkLogic is expected
110123 to return a 403. And the documents.search method is then expected to return the
111124 Response so that the user has access to everything in it."""
125+
126+
127+ def test_version_id (client : Client ):
128+ equalSignEtag = (
129+ client .get ("v1/documents?uri=/doc2=copy.xml" )
130+ .headers ["ETag" ]
131+ .replace ('"' , "" )
132+ )
133+
134+ semicolonEtag = (
135+ client .get ("v1/documents?uri=/doc2;copy.xml" )
136+ .headers ["ETag" ]
137+ .replace ('"' , "" )
138+ )
139+
140+ docs = client .documents .search (
141+ categories = ["content" , "collections" ], collections = ["search-test" ]
142+ )
143+
144+ doc1 = next (doc for doc in docs if doc .uri == "/doc2=copy.xml" )
145+ assert doc1 .version_id == equalSignEtag
146+
147+ doc2 = next (doc for doc in docs if doc .uri == "/doc2;copy.xml" )
148+ assert doc2 .version_id == semicolonEtag
0 commit comments