comparison commons/pyRepetUnit/profilesDB/tests/Test_F_ProfilesDB2Map.py @ 31:0ab839023fe4

Uploaded
author m-zytnicki
date Tue, 30 Apr 2013 14:33:21 -0400
parents 94ab73e8a190
children
comparison
equal deleted inserted replaced
30:5677346472b5 31:0ab839023fe4
1 import os
2 import unittest
3 from commons.core.utils.FileUtils import FileUtils
4 from commons.pyRepetUnit.profilesDB.ProfilesDB2Map import ProfilesDB2Map
5
6 class Test_F_ProfilesDB2Map(unittest.TestCase):
7
8 def setUp(self):
9 self.profilesDB2Map = ProfilesDB2Map()
10 self._inputFile = "./datas/myhmms"
11 self._outputFile = "./datas/outputFile.map"
12 self._expectedFile = "./datas/profiles.map"
13 self._createProfilesMapFile()
14
15 def tearDown(self):
16 os.remove(self._outputFile)
17 os.remove(self._expectedFile)
18
19 def testRun(self):
20 self.profilesDB2Map.setInputFile(self._inputFile)
21 self.profilesDB2Map.setOutputFile(self._outputFile)
22 pfamDB = self.profilesDB2Map.run()
23 self.assertTrue(FileUtils.are2FilesIdentical(self._expectedFile, self._outputFile))
24
25 def _createProfilesMapFile(self):
26 f = open(self._expectedFile, "w")
27 f.write("rrm\t\t1\t77\n")
28 f.write("fn3\tFibronectin type III domain\t1\t84\n")
29 f.write("pkinase\tProtein kinase domain\t1\t294\n")
30 f.close()
31
32
33 if __name__ == "__main__":
34 unittest.main()