Skip to content

Commit 428329d

Browse files
author
Manuel Kösters
committed
Save GSGW test output file to example_data
- example data for GSGW is saved to example_data and clean up is attempted
1 parent cb8a479 commit 428329d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/file_io_indexed_gzip_writer_test.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,14 @@ def setUp(self):
3030
def tearDown(self):
3131
""" """
3232
self.Writer.close()
33-
os.remove(os.path.abspath(os.path.join(".", "tests", "data", "unittest.mzml")))
33+
try:
34+
os.remove(os.path.abspath(os.path.join(".", "tests", "data", "unittest.mzml")))
35+
except FileNotFoundError:
36+
pass
37+
try:
38+
os.remove(os.path.abspath(os.path.join(".", "tests", "data", "unittest2.mzml")))
39+
except FileNotFoundError:
40+
pass
3441

3542
def test_init(self):
3643
self.assertEqual(self.Writer.crc32, 0)
@@ -128,7 +135,9 @@ def test_add_data(self):
128135
"uncompressed",
129136
"CF_07062012_pH8_2_3A.mzML",
130137
)
131-
self.Writer = GSGW(test_file, max_idx=80, max_idx_len=8, max_offset_len=8)
138+
self.Writer = GSGW(test_file, max_idx=80, max_idx_len=8, max_offset_len=8, output_path=os.path.abspath(
139+
os.path.join(".", "tests", "data", "unittest2.mzml")
140+
))
132141
self.Writer.add_data(test_string, "a")
133142
self.Writer.close()
134143
file = open(self.paths[0], "rb")

0 commit comments

Comments
 (0)