File: file_io_file_interface_test.py

package info (click to toggle)
python-pymzml 2.5.2%2Brepack1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 27,792 kB
  • sloc: python: 6,495; pascal: 341; makefile: 233; sh: 30
file content (50 lines) | stat: -rwxr-xr-x 1,280 bytes parent folder | download | duplicates (2)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Part of pymzml test cases
"""
import os
from pymzml.file_interface import FileInterface
from pymzml.file_classes.standardGzip import StandardGzip
from pymzml.file_classes.indexedGzip import IndexedGzip
from pymzml.file_classes.standardMzml import StandardMzml
import unittest
import test_file_paths


class FileInterfaceTest(unittest.TestCase):
    """
    """

    def setUp(self):
        """
        """
        self.paths = test_file_paths.paths
        test_file = self.paths[1]
        self.File = FileInterface(test_file, "latin-1")

    def tearDown(self):
        """
        """
        self.File.close()

    def test_init(self):
        """
        """
        self.assertIsNotNone(self.File.file_handler)

    def test_open(self):
        """
        """
        self.assertIsInstance(self.File.file_handler, StandardGzip)
        self.File.close()
        self.File = FileInterface(self.paths[0], "latin-1")
        self.assertIsInstance(self.File.file_handler, StandardMzml)
        self.File.close()
        self.File = FileInterface(self.paths[2], "latin-1")
        self.assertIsInstance(self.File.file_handler, IndexedGzip)
        self.File.close()


if __name__ == "__main__":
    unittest.main(verbosity=3)