@@ -296,7 +296,7 @@ def test_write_rels_empty(self):
296
296
297
297
file .seek (0 )
298
298
root = xml .etree .ElementTree .ElementTree (file = file ).getroot ()
299
- relationships = root .findall ("rel:Relationship" , namespaces = RELS_NAMESPACES )
299
+ relationships = root .findall (RELS_RELATIONSHIP_FIND , namespaces = RELS_NAMESPACES )
300
300
self .assertEqual (
301
301
len (relationships ),
302
302
1 ,
@@ -328,7 +328,7 @@ def test_write_rels_different_annotations(self):
328
328
329
329
file .seek (0 )
330
330
root = xml .etree .ElementTree .ElementTree (file = file ).getroot ()
331
- relationships = root .findall ("rel:Relationship" , namespaces = RELS_NAMESPACES )
331
+ relationships = root .findall (RELS_RELATIONSHIP_FIND , namespaces = RELS_NAMESPACES )
332
332
self .assertEqual (
333
333
len (relationships ),
334
334
1 ,
@@ -349,7 +349,7 @@ def test_write_rels_relationship(self):
349
349
350
350
file .seek (0 )
351
351
root = xml .etree .ElementTree .ElementTree (file = file ).getroot ()
352
- relationships = root .findall ("rel:Relationship" , namespaces = RELS_NAMESPACES )
352
+ relationships = root .findall (RELS_RELATIONSHIP_FIND , namespaces = RELS_NAMESPACES )
353
353
self .assertEqual (
354
354
len (relationships ),
355
355
2 ,
@@ -373,14 +373,15 @@ def test_write_rels_different_source(self):
373
373
custom_file = io .BytesIO ()
374
374
custom_file .close = lambda : None
375
375
# Return the correct file handle depending on which file is opened.
376
- archive .open = lambda fname , * args , ** kwargs : custom_file if fname == "3D/" + RELS_FOLDER + "/.rels" else root_file
376
+ archive .open = lambda fname , * args , ** kwargs :\
377
+ custom_file if fname == "3D/" + RELS_FOLDER + "/.rels" else root_file
377
378
378
379
self .annotations .annotations ["file.txt" ] = {io_mesh_3mf .annotations .Relationship (namespace = "nsp" , source = "3D/" )}
379
380
self .annotations .write_rels (archive )
380
381
381
382
custom_file .seek (0 )
382
383
root = xml .etree .ElementTree .ElementTree (file = custom_file ).getroot ()
383
- relationships = root .findall ("rel:Relationship" , namespaces = RELS_NAMESPACES )
384
+ relationships = root .findall (RELS_RELATIONSHIP_FIND , namespaces = RELS_NAMESPACES )
384
385
self .assertEqual (len (relationships ), 1 , "Only the custom relationship got saved to this file." )
385
386
self .assertEqual (relationships [0 ].attrib ["Target" ], "/file.txt" , "The target of the relationship is absolute." )
386
387
self .assertEqual (relationships [0 ].attrib ["Type" ], "nsp" , "This is the namespace we added." )
0 commit comments