Mercurial > repos > pieterlukasse > prims_metabolomics
view rankfilter_GCMS/test/test_pdfread.py @ 4:80075a4c6543
updated image paths
author | pieter.lukasse@wur.nl |
---|---|
date | Fri, 17 Jan 2014 12:43:05 +0100 |
parents | 9d5f4f5f764b |
children | 53e1eee93430 |
line wrap: on
line source
''' Created on Mar 13, 2012 @author: marcelk ''' from GCMS.rankfilter_GCMS import pdfread # @UnresolvedImport from pkg_resources import resource_filename # @UnresolvedImport # pylint: disable=E0611 import unittest class Test(unittest.TestCase): def setUp(self): self.nist_pdf = resource_filename(__name__, "data/NIST_test_PDF.txt") def test_getPDF(self): ''' Tests the reading and parsing of a NIST PDF file ''' [hitlist, hitlist_missed] = pdfread.getPDF(self.nist_pdf) rows = [hitlist[row] for row in hitlist.keys()] data = [set(row) for row in zip(*rows)] expected_element = set(('12.3', ' Sucrose ', '14', 'undef', ' standards 2009', ' 660', 'not_def', '18495-0.142537-21284-2.26544e+07-135', '22.6544', ' 714')) self.failUnless(expected_element in data) self.failUnless(len(hitlist_missed) != 0) if __name__ == "__main__": #import sys;sys.argv = ['', 'Test.test_getPDF'] unittest.main()