annotate SMART/Java/Python/test/Test_F_plot.py @ 18:94ab73e8a190

Uploaded
author m-zytnicki
date Mon, 29 Apr 2013 03:20:15 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
1 import unittest
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
2 import os
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
3 from commons.core.utils.FileUtils import FileUtils
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
4
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
5 TestF_PATH = os.environ['REPET_PATH'] + '/SMART/Java/Python/TestFiles'
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
6
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
7
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
8 class Test_F_plot(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.outputFileName = "testOut.png"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
12
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
13 def tearDown(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
14 os.remove(self.outputFileName)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
15
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
16 def test_run_default_option(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
17 cmd = "python ../plot.py -i %s/mapperAnalyzerOutput.gff3 -f gff3 -x identity -y nbMismatches -s line -o %s " % (TestF_PATH, self.outputFileName)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
18 os.system(cmd)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
19 self.assertTrue(FileUtils.isRessourceExists(self.outputFileName))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
20
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
21 def test_run_log_option(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
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)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
23 os.system(cmd)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
24 self.assertTrue(FileUtils.isRessourceExists(self.outputFileName))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
25
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
26 def test_run_z_xDefault_yDefault_heatPoints_option(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
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)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
28 os.system(cmd)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
29 self.assertTrue(FileUtils.isRessourceExists(self.outputFileName))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
30
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
31 def test_points_option(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
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)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
33 os.system(cmd)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
34 self.assertTrue(FileUtils.isRessourceExists(self.outputFileName))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
35
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
36 def test_xDefault_points_option(self):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
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)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
38 os.system(cmd)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
39 self.assertTrue(FileUtils.isRessourceExists(self.outputFileName))
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
40
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
41 if __name__ == "__main__":
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
42 unittest.main()