Mercurial > repos > pieterlukasse > prims_metabolomics
view test/test_query_mass_repos.py @ 26:637830ac8bcd
added validation in metexp to tabular tool; added workaround/fix for L and D compound types
author | pieter.lukasse@wur.nl |
---|---|
date | Thu, 24 Apr 2014 11:28:38 +0200 |
parents | 85fd05d0d16c |
children |
line wrap: on
line source
'''Integration tests for the GCMS project''' from pkg_resources import resource_filename # @UnresolvedImport # pylint: disable=E0611 from MS import query_mass_repos import os.path import sys import unittest class IntegrationTest(unittest.TestCase): def test_simple(self): ''' Simple initial test ''' # Create out folder outdir = "output/query_mass_repos/" if not os.path.exists(outdir): os.makedirs(outdir) #Build up arguments and run # input_file = sys.argv[1] # molecular_mass_col = sys.argv[2] # repository_file = sys.argv[3] # mass_tolerance = float(sys.argv[4]) # output_result = sys.argv[5] input_file = resource_filename(__name__, "data/service_query_tabular.txt") molecular_mass_col = "mass (Da)" dblink_file = resource_filename(__name__, "data/MFSearcher ExactMassDB service.txt") output_result = resource_filename(__name__, outdir + "metexp_query_results_added.txt") sys.argv = ['test', input_file, molecular_mass_col, dblink_file, '0.001', 'ms', output_result] # Execute main function with arguments provided through sys.argv query_mass_repos.main() def _read_file(filename): ''' Helper method to quickly read a file @param filename: ''' with open(filename) as handle: return handle.read()