erange version 4.0a dev release
[erange.git] / test / testRegion.py
1 import unittest
2 from erange import Region
3
4
5 class TestRegion(unittest.TestCase):
6
7
8     def setUp(self):
9         pass
10
11
12     def tearDown(self):
13         pass
14
15
16     def testRegion(self):
17         factor = "foo"
18         region = Region.Region(factor, "index", "chrom", "start", "stop", "numReads", "foldRatio", "multiP", "peakDescription", "shift")
19         self.assertEquals(factor, region.factor)
20
21
22     def testDirectionalRegion(self):
23         factor = "foo"
24         region = Region.DirectionalRegion(factor, "index", "chrom", "start", "stop", "numReads", "foldRatio", "multiP", "plusP", "leftP", "peakDescription", "shift")
25         self.assertEquals(factor, region.factor)
26
27
28     def testPrintDeirectionalRegionWithShift(self):
29         factor = "foo"
30         region = Region.DirectionalRegion(factor, 1, "chrom", 10, 100, 1.0, 0.5, 0.4, 0.3, 0.2, "peakDescription", 9)
31         result = "foo1\tchrom\t10\t100\t1.0\t0.5\t0.4\t0.3\t0.2\tpeakDescription\t9"
32         self.assertEquals(result, region.printRegionWithShift())
33
34
35 def suite():
36     suite = unittest.TestSuite()
37     suite.addTest(unittest.makeSuite(TestRegion))
38
39     return suite
40
41
42 if __name__ == "__main__":
43     #import sys;sys.argv = ['', 'Test.testName']
44     unittest.main()