Skip to content

Commit 954a10d

Browse files
committed
update patch tests to rdflib@2.3.2
1 parent 9436591 commit 954a10d

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

test/integration/patch-test.mjs

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ describe('PATCH through text/n3', () => {
9393
}, { // expected:
9494
status: 201,
9595
text: 'Patch applied successfully',
96-
result: '@prefix : </new.ttl#>.\n@prefix tim: </>.\n\ntim:x tim:y tim:z.\n\n'
96+
// result: '@prefix : </new.ttl#>.\n@prefix tim: </>.\n\ntim:x tim:y tim:z.\n\n'
97+
result: '@prefix : </new.ttl#>.\n\n</x> </y> </z>.\n\n'
9798
}))
9899

99100
describe('on a non-existent JSON-LD file', describePatch({
@@ -105,14 +106,20 @@ describe('PATCH through text/n3', () => {
105106
status: 201,
106107
text: 'Patch applied successfully',
107108
// result: '{\n "@id": "/x",\n "/y": {\n "@id": "/z"\n }\n}'
108-
result: `{
109+
/* result: `{
109110
"@context": {
110111
"tim": "https://tim.localhost:7777/"
111112
},
112113
"@id": "tim:x",
113114
"tim:y": {
114115
"@id": "tim:z"
115116
}
117+
}` */
118+
result: `{
119+
"@id": "https://tim.localhost:7777/x",
120+
"https://tim.localhost:7777/y": {
121+
"@id": "https://tim.localhost:7777/z"
122+
}
116123
}`
117124
}))
118125

@@ -140,7 +147,8 @@ describe('PATCH through text/n3', () => {
140147
}, { // expected:
141148
status: 201,
142149
text: 'Patch applied successfully',
143-
result: '@prefix : </new.n3#>.\n@prefix tim: </>.\n\ntim:x tim:y tim:z.\n\n'
150+
// result: '@prefix : </new.n3#>.\n@prefix tim: </>.\n\ntim:x tim:y tim:z.\n\n'
151+
result: '@prefix : </new.n3#>.\n\n</x> </y> </z>.\n\n'
144152
}))
145153

146154
describe('on an N3 file that has an invalid uri (*.acl)', describePatch({
@@ -179,7 +187,8 @@ describe('PATCH through text/n3', () => {
179187
}, { // expected:
180188
status: 200,
181189
text: 'Patch applied successfully',
182-
result: '@prefix : </append-only.ttl#>.\n@prefix tim: </>.\n\ntim:a tim:b tim:c.\n\ntim:d tim:e tim:f.\n\ntim:x tim:y tim:z.\n\n'
190+
// result: '@prefix : </append-only.ttl#>.\n@prefix tim: </>.\n\ntim:a tim:b tim:c.\n\ntim:d tim:e tim:f.\n\ntim:x tim:y tim:z.\n\n'
191+
result: '@prefix : </append-only.ttl#>.\n\n</a> </b> </c>.\n\n</d> </e> </f>.\n\n</x> </y> </z>.\n\n'
183192
}))
184193

185194
describe('on a resource with write-only access', describePatch({
@@ -189,7 +198,8 @@ describe('PATCH through text/n3', () => {
189198
}, { // expected:
190199
status: 200,
191200
text: 'Patch applied successfully',
192-
result: '@prefix : </write-only.ttl#>.\n@prefix tim: </>.\n\ntim:a tim:b tim:c.\n\ntim:d tim:e tim:f.\n\ntim:x tim:y tim:z.\n\n'
201+
// result: '@prefix : </write-only.ttl#>.\n@prefix tim: </>.\n\ntim:a tim:b tim:c.\n\ntim:d tim:e tim:f.\n\ntim:x tim:y tim:z.\n\n'
202+
result: '@prefix : </write-only.ttl#>.\n\n</a> </b> </c>.\n\n</d> </e> </f>.\n\n</x> </y> </z>.\n\n'
193203
}))
194204

195205
describe('on a resource with parent folders that do not exist', describePatch({
@@ -200,7 +210,8 @@ describe('PATCH through text/n3', () => {
200210
}, {
201211
status: 201,
202212
text: 'Patch applied successfully',
203-
result: '@prefix : <#>.\n@prefix fol: <./>.\n\nfol:x fol:y fol:z.\n\n'
213+
// result: '@prefix : <#>.\n@prefix fol: <./>.\n\nfol:x fol:y fol:z.\n\n'
214+
result: '@prefix : <#>.\n\n<x> <y> <z>.\n\n'
204215
}))
205216
})
206217

@@ -258,7 +269,8 @@ describe('PATCH through text/n3', () => {
258269
}, { // expected:
259270
status: 200,
260271
text: 'Patch applied successfully',
261-
result: '@prefix : </read-append.ttl#>.\n@prefix tim: </>.\n\ntim:a tim:b tim:c; tim:y tim:z.\n\ntim:d tim:e tim:f.\n\n'
272+
// result: '@prefix : </read-append.ttl#>.\n@prefix tim: </>.\n\ntim:a tim:b tim:c; tim:y tim:z.\n\ntim:d tim:e tim:f.\n\n'
273+
result: '@prefix : </read-append.ttl#>.\n\n</a> </b> </c>; </y> </z>.\n\n</d> </e> </f>.\n\n'
262274
}))
263275

264276
describe('with a non-matching WHERE clause', describePatch({
@@ -281,7 +293,8 @@ describe('PATCH through text/n3', () => {
281293
}, { // expected:
282294
status: 200,
283295
text: 'Patch applied successfully',
284-
result: '@prefix : </read-write.ttl#>.\n@prefix tim: </>.\n\ntim:a tim:b tim:c; tim:y tim:z.\n\ntim:d tim:e tim:f.\n\n'
296+
// result: '@prefix : </read-write.ttl#>.\n@prefix tim: </>.\n\ntim:a tim:b tim:c; tim:y tim:z.\n\ntim:d tim:e tim:f.\n\n'
297+
result: '@prefix : </read-write.ttl#>.\n\n</a> </b> </c>; </y> </z>.\n\n</d> </e> </f>.\n\n'
285298
}))
286299

287300
describe('with a non-matching WHERE clause', describePatch({
@@ -354,7 +367,8 @@ describe('PATCH through text/n3', () => {
354367
}, { // expected:
355368
status: 200,
356369
text: 'Patch applied successfully',
357-
result: '@prefix : </read-write.ttl#>.\n@prefix tim: </>.\n\ntim:d tim:e tim:f.\n\n'
370+
// result: '@prefix : </read-write.ttl#>.\n@prefix tim: </>.\n\ntim:d tim:e tim:f.\n\n'
371+
result: '@prefix : </read-write.ttl#>.\n\n</d> </e> </f>.\n\n'
358372
}))
359373

360374
describe('with a patch for non-existing data', describePatch({
@@ -374,7 +388,8 @@ describe('PATCH through text/n3', () => {
374388
}, { // expected:
375389
status: 200,
376390
text: 'Patch applied successfully',
377-
result: '@prefix : </read-write.ttl#>.\n@prefix tim: </>.\n\ntim:d tim:e tim:f.\n\n'
391+
// result: '@prefix : </read-write.ttl#>.\n@prefix tim: </>.\n\ntim:d tim:e tim:f.\n\n'
392+
result: '@prefix : </read-write.ttl#>.\n\n</d> </e> </f>.\n\n'
378393
}))
379394

380395
describe('with a non-matching WHERE clause', describePatch({
@@ -463,7 +478,8 @@ describe('PATCH through text/n3', () => {
463478
}, { // expected:
464479
status: 200,
465480
text: 'Patch applied successfully',
466-
result: '@prefix : </read-write.ttl#>.\n@prefix tim: </>.\n\ntim:d tim:e tim:f.\n\ntim:x tim:y tim:z.\n\n'
481+
// result: '@prefix : </read-write.ttl#>.\n@prefix tim: </>.\n\ntim:d tim:e tim:f.\n\ntim:x tim:y tim:z.\n\n'
482+
result: '@prefix : </read-write.ttl#>.\n\n</d> </e> </f>.\n\n</x> </y> </z>.\n\n'
467483
}))
468484

469485
describe('with a patch for non-existing data', describePatch({
@@ -485,7 +501,8 @@ describe('PATCH through text/n3', () => {
485501
}, { // expected:
486502
status: 200,
487503
text: 'Patch applied successfully',
488-
result: '@prefix : </read-write.ttl#>.\n@prefix tim: </>.\n\ntim:a tim:y tim:z.\n\ntim:d tim:e tim:f.\n\n'
504+
// result: '@prefix : </read-write.ttl#>.\n@prefix tim: </>.\n\ntim:a tim:y tim:z.\n\ntim:d tim:e tim:f.\n\n'
505+
result: '@prefix : </read-write.ttl#>.\n\n</a> </y> </z>.\n\n</d> </e> </f>.\n\n'
489506
}))
490507

491508
describe('with a non-matching WHERE clause', describePatch({

0 commit comments

Comments
 (0)