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_classes.standardMzml import StandardMzml
import unittest
from pymzml.spec import Spectrum, Chromatogram
import test_file_paths
class StandardMzmlTest(unittest.TestCase):
"""
"""
def setUp(self):
"""
"""
paths = test_file_paths.paths
self.standard_mzml = StandardMzml(paths[0], "latin-1")
def tearDown(self):
"""
"""
self.standard_mzml.close()
def test_getitem(self):
"""
"""
ID = 8
spec = self.standard_mzml[ID]
self.assertIsInstance(spec, Spectrum)
target_ID = spec.ID
self.assertEqual(ID, target_ID)
ID = "TIC"
chrom = self.standard_mzml[ID]
self.assertIsInstance(chrom, Chromatogram)
self.assertEqual(ID, chrom.ID)
def test_interpol_search(self):
"""
"""
spec = self.standard_mzml._interpol_search(5)
self.assertIsInstance(spec, Spectrum)
if __name__ == "__main__":
unittest.main(verbosity=3)
|