annotate commons/pyRepetUnit/align/hmmOutputParsing/tests/Test_F_HmmscanOutput2align.py @ 31:0ab839023fe4

Uploaded
author m-zytnicki
date Tue, 30 Apr 2013 14:33:21 -0400
parents 94ab73e8a190
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
1 import os
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
2 import unittest
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
3 from commons.pyRepetUnit.align.hmmOutputParsing.HmmscanOutput2align import HmmscanOutput2align
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
4 from commons.core.utils.FileUtils import FileUtils
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
5
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
6 CURRENT_DIR = os.getcwd()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
7
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
8 class Test_F_HmmscanOutput2align(unittest.TestCase):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
9
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
10 def setUp(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
11 self.hmmscanOutput2align = HmmscanOutput2align()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
12 self._inputFile = os.environ["REPET_PATH"] + "/commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutput"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
13 self._outputFile = "./datas/test_hmmscanOutput.align"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
14 os.chdir(CURRENT_DIR)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
15
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
16 def testParseHmmscanOutput2align(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
17 self.hmmscanOutput2align.setInputFile(self._inputFile)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
18 self.hmmscanOutput2align.setOutputFile(self._outputFile)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
19 self.hmmscanOutput2align.run()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
20 expectedFile = os.environ["REPET_PATH"] + "/commons/pyRepetUnit/hmmer/hmmOutput/tests/datas/hmmscanOutput.align"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
21 self.assertTrue(FileUtils.isRessourceExists(self._outputFile))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
22 self.assertTrue(FileUtils.are2FilesIdentical(expectedFile, self._outputFile))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
23 os.remove( self._outputFile )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
24
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
25
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
26 if __name__ == "__main__":
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
27 unittest.main()