18
|
1 import unittest
|
|
2 import os
|
|
3 from commons.core.utils.FileUtils import FileUtils
|
|
4
|
|
5 TestF_PATH = os.environ['REPET_PATH'] + '/SMART/Java/Python/TestFiles'
|
|
6
|
|
7
|
|
8 class Test_F_plot(unittest.TestCase):
|
|
9
|
|
10 def setUp(self):
|
|
11 self.outputFileName = "testOut.png"
|
|
12
|
|
13 def tearDown(self):
|
|
14 os.remove(self.outputFileName)
|
|
15
|
|
16 def test_run_default_option(self):
|
|
17 cmd = "python ../plot.py -i %s/mapperAnalyzerOutput.gff3 -f gff3 -x identity -y nbMismatches -s line -o %s " % (TestF_PATH, self.outputFileName)
|
|
18 os.system(cmd)
|
|
19 self.assertTrue(FileUtils.isRessourceExists(self.outputFileName))
|
|
20
|
|
21 def test_run_log_option(self):
|
|
22 cmd = "python ../plot.py -i %s/mapperAnalyzerOutput.gff3 -f gff3 -x identity -y nbMismatches -s line -o %s -l xy" % (TestF_PATH, self.outputFileName)
|
|
23 os.system(cmd)
|
|
24 self.assertTrue(FileUtils.isRessourceExists(self.outputFileName))
|
|
25
|
|
26 def test_run_z_xDefault_yDefault_heatPoints_option(self):
|
|
27 cmd = "python ../plot.py -i %s/testPlot.gff3 -f gff3 -x value1 -X 1 -y value2 -Y 1 -z value3 -s heatPoints -o %s -v 10 " % (TestF_PATH, self.outputFileName)
|
|
28 os.system(cmd)
|
|
29 self.assertTrue(FileUtils.isRessourceExists(self.outputFileName))
|
|
30
|
|
31 def test_points_option(self):
|
|
32 cmd = "python ../plot.py -i %s/testPlot.gff3 -f gff3 -x value1 -X 1 -y value2 -Y 1 -s points -o %s -v 10 " % (TestF_PATH, self.outputFileName)
|
|
33 os.system(cmd)
|
|
34 self.assertTrue(FileUtils.isRessourceExists(self.outputFileName))
|
|
35
|
|
36 def test_xDefault_points_option(self):
|
|
37 cmd = "python ../plot.py -i %s/testPlot.gff3 -f gff3 -x value1 -X 1 -n 2 -s barplot -o %s -v 10 " % (TestF_PATH, self.outputFileName)
|
|
38 os.system(cmd)
|
|
39 self.assertTrue(FileUtils.isRessourceExists(self.outputFileName))
|
|
40
|
|
41 if __name__ == "__main__":
|
|
42 unittest.main() |