File: save-gsgw-test-output-to-example-data.patch

package info (click to toggle)
python-pymzml 2.5.10%2Brepack1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,104 kB
  • sloc: python: 5,965; pascal: 341; makefile: 211; sh: 29
file content (36 lines) | stat: -rw-r--r-- 1,495 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Description: Save GSGW test output file to example_data
Author: Manuel Kösters <test@example.com>
Origin: upstream, https://github.com/pymzml/pymzML/commit/428329dd10fac5ae5fd2e72ffa6c0153d6e39491
Bug-Debian: https://bugs.debian.org/1122312

- example data for GSGW is saved to example_data and clean up is attempted

--- a/tests/file_io_indexed_gzip_writer_test.py
+++ b/tests/file_io_indexed_gzip_writer_test.py
@@ -30,7 +30,14 @@
     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)
@@ -128,7 +135,9 @@
             "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")