X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=erange.git;a=blobdiff_plain;f=test%2FtestRegion.py;fp=test%2FtestRegion.py;h=f1ffd52bb74c375de5f518a5318c3526e5f32e5c;hp=0000000000000000000000000000000000000000;hb=0d3e3112fd04c2e6b44a25cacef1d591658ad181;hpb=5e4ae21098dba3d1edcf11e7279da0d84c3422e4 diff --git a/test/testRegion.py b/test/testRegion.py new file mode 100644 index 0000000..f1ffd52 --- /dev/null +++ b/test/testRegion.py @@ -0,0 +1,44 @@ +import unittest +from erange import Region + + +class TestRegion(unittest.TestCase): + + + def setUp(self): + pass + + + def tearDown(self): + pass + + + def testRegion(self): + factor = "foo" + region = Region.Region(factor, "index", "chrom", "start", "stop", "numReads", "foldRatio", "multiP", "peakDescription", "shift") + self.assertEquals(factor, region.factor) + + + def testDirectionalRegion(self): + factor = "foo" + region = Region.DirectionalRegion(factor, "index", "chrom", "start", "stop", "numReads", "foldRatio", "multiP", "plusP", "leftP", "peakDescription", "shift") + self.assertEquals(factor, region.factor) + + + def testPrintDeirectionalRegionWithShift(self): + factor = "foo" + region = Region.DirectionalRegion(factor, 1, "chrom", 10, 100, 1.0, 0.5, 0.4, 0.3, 0.2, "peakDescription", 9) + result = "foo1\tchrom\t10\t100\t1.0\t0.5\t0.4\t0.3\t0.2\tpeakDescription\t9" + self.assertEquals(result, region.printRegionWithShift()) + + +def suite(): + suite = unittest.TestSuite() + suite.addTest(unittest.makeSuite(TestRegion)) + + return suite + + +if __name__ == "__main__": + #import sys;sys.argv = ['', 'Test.testName'] + unittest.main() \ No newline at end of file