File tree Expand file tree Collapse file tree
tests/imagej/bioformats/write_bf_memoryfile Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33
44import os
5+ from imcflibs .pathtools import parse_path
56from imcflibs .imagej import bioformats
67
78
8- parent_dir = str ( PYTHON_IMCFLIBS_TESTDATA ). replace ( " \\ " , "/" )
9- filename = "10x_phmax.czi"
10- full_path = parent_dir + "/ " + "10x_phmax.czi "
11- bfmemofilename = "." + filename + ".bfmemo"
12- os .chdir ( parent_dir ) # DANGEROUS, relative paths and calling remove() below!
13- if os . path . isfile ( bfmemofilename ):
14- print ( "bf memo file already existed and was removed" )
15- os . remove ( bfmemofilename )
9+ components = parse_path ( "systems/lsm700/beads/10x_phmax.czi" , PYTHON_IMCFLIBS_TESTDATA )
10+ full_path = components [ "full" ]
11+ bfmemofile = components [ "path" ] + ". " + components [ "fname" ] + ".bfmemo "
12+
13+ if os .path . isfile ( bfmemofile ):
14+ print ( "BF memory file [%s] already exists, removing..." % bfmemofile )
15+ os . remove ( bfmemofile )
16+
1617
1718bioformats .write_bf_memoryfile (full_path )
1819
19- if not os .path .isfile (bfmemofilename ):
20- print ("Test FAILED. A bf memo file does not exist." )
20+
21+ if not os .path .isfile (bfmemofile ):
22+ print ("Test FAILED: can't find BF memory file [%s]" % bfmemofile )
2123else :
22- print ("Test passed. A bf memo file was created." )
24+ print ("Test passed, BF memory file [%s] was created." % bfmemofile )
You can’t perform that action at this time.
0 commit comments