Mercurial > repos > yufei-luo > s_mart
view commons/tools/tests/Test_F_ReplaceGreaterThanSymbolInFastaHeader.py @ 18:94ab73e8a190
Uploaded
author | m-zytnicki |
---|---|
date | Mon, 29 Apr 2013 03:20:15 -0400 |
parents | |
children |
line wrap: on
line source
import unittest import os from commons.core.utils.FileUtils import FileUtils from commons.tools.tests.MockFastaForReplaceGreaterThanSymbolInFastaHeader import MockFastaForReplaceGreaterThanSymbolInFastaHeader_withoutGreaterThan,\ MockFastaForReplaceGreaterThanSymbolInFastaHeader from commons.tools.replaceGreaterThanSymbolInFastaHeaderProgramLauncher import replaceGreaterThanSymbolInFastaHeaderProgramLauncher class Test_F_ReplaceGreaterThanSymbolInHeader(unittest.TestCase): def test_run(self): inputFileName = "dummy_fasta.fsa" mockInput = MockFastaForReplaceGreaterThanSymbolInFastaHeader() mockInput.write(inputFileName) expFileName = "exp_dummy_fasta.preprocessed.fsa" mockInput = MockFastaForReplaceGreaterThanSymbolInFastaHeader_withoutGreaterThan() mockInput.write(expFileName) obsFileName = "dummy_fasta.preprocessed.fasta" rgtspl = replaceGreaterThanSymbolInFastaHeaderProgramLauncher() rgtspl.setInputFile(inputFileName) rgtspl.run() self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) os.remove(inputFileName) os.remove(expFileName) os.remove(obsFileName) def test_run_as_script(self): inputFileName = "dummy_fasta.fsa" mockInput = MockFastaForReplaceGreaterThanSymbolInFastaHeader() mockInput.write(inputFileName) expFileName = "exp_dummy_fasta.preprocessed.fsa" mockInput = MockFastaForReplaceGreaterThanSymbolInFastaHeader_withoutGreaterThan() mockInput.write(expFileName) obsFileName = "dummy_fasta.preprocessed.fasta" cmd2Launch = "replaceGreaterThanSymbolInFastaHeaderProgramLauncher.py -i " + inputFileName os.system(cmd2Launch) self.assertTrue(FileUtils.are2FilesIdentical(expFileName, obsFileName)) os.remove(inputFileName) os.remove(expFileName) os.remove(obsFileName) if __name__ == "__main__": unittest.main()