Skip to content

Commit

Permalink
Save GSGW test output file to example_data
Browse files Browse the repository at this point in the history
- example data for GSGW is saved to example_data and clean up is attempted
  • Loading branch information
Manuel Kösters committed Sep 2, 2024
1 parent cb8a479 commit 428329d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/file_io_indexed_gzip_writer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ def setUp(self):
def tearDown(self):
""" """
self.Writer.close()
os.remove(os.path.abspath(os.path.join(".", "tests", "data", "unittest.mzml")))
try:
os.remove(os.path.abspath(os.path.join(".", "tests", "data", "unittest.mzml")))
except FileNotFoundError:
pass
try:
os.remove(os.path.abspath(os.path.join(".", "tests", "data", "unittest2.mzml")))
except FileNotFoundError:
pass

def test_init(self):
self.assertEqual(self.Writer.crc32, 0)
Expand Down Expand Up @@ -128,7 +135,9 @@ def test_add_data(self):
"uncompressed",
"CF_07062012_pH8_2_3A.mzML",
)
self.Writer = GSGW(test_file, max_idx=80, max_idx_len=8, max_offset_len=8)
self.Writer = GSGW(test_file, max_idx=80, max_idx_len=8, max_offset_len=8, output_path=os.path.abspath(
os.path.join(".", "tests", "data", "unittest2.mzml")
))
self.Writer.add_data(test_string, "a")
self.Writer.close()
file = open(self.paths[0], "rb")
Expand Down

0 comments on commit 428329d

Please sign in to comment.