18
|
1 import unittest
|
|
2 import os
|
|
3 from commons.core.utils.FileUtils import FileUtils
|
|
4 from commons.launcher import launchTEclass
|
|
5
|
|
6
|
|
7 class Test_launchTEclass( unittest.TestCase ):
|
|
8
|
|
9 def test_parseFastaFileFromTEclass( self ):
|
|
10 inFile = "dummyLibFile.fa"
|
|
11 inHandler = open( inFile, "w" )
|
|
12 inHandler.write( ">1360|TEclass result: DNA|ORFs: 1360..2226:+1\n" )
|
|
13 inHandler.write( "AGCATGACGCA\n" )
|
|
14 inHandler.write( ">FB|TEclass result: unclear\n" )
|
|
15 inHandler.write( "GCATGCAGCGACGCGAC\n" )
|
|
16 inHandler.close()
|
|
17
|
|
18 expFile = "dummyExpFile.map"
|
|
19 expHandler = open( expFile, "w" )
|
|
20 expHandler.write( "DNA\t1360\t1\t11\n" )
|
|
21 expHandler.write( "unclear\tFB\t1\t17\n" )
|
|
22 expHandler.close()
|
|
23
|
|
24 obsFile = "dummyObsFile.map"
|
|
25
|
|
26 launchTEclass.parseFastaFileFromTEclass( inFile, obsFile )
|
|
27
|
|
28 self.assertTrue( FileUtils.are2FilesIdentical( expFile, obsFile ) )
|
|
29
|
|
30 for f in [ inFile, expFile, obsFile ]:
|
|
31 os.remove( f )
|
|
32
|
|
33 if __name__ == "__main__":
|
|
34 unittest.main() |