X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=blobdiff_plain;f=htsworkflow%2Fsubmission%2Ftest%2Ftest_results.py;fp=htsworkflow%2Fsubmission%2Ftest%2Ftest_results.py;h=b7d6accd73af229fe12ac43dd3db07785a5c8740;hp=3487b69d7e410f1734887f6afd0969013f0466ff;hb=d4f592d5c162b136cdf38a5626cea97b9e7844df;hpb=032bcfb3733bd54953cd29be54b9de8cfb1f5cc4 diff --git a/htsworkflow/submission/test/test_results.py b/htsworkflow/submission/test/test_results.py index 3487b69..b7d6acc 100644 --- a/htsworkflow/submission/test/test_results.py +++ b/htsworkflow/submission/test/test_results.py @@ -74,13 +74,32 @@ class TestResultMap(TestCase): self.assertFalse(u'77777' in results) self.assertFalse('77777' in results) - def test_make_from(self): + def test_make_from_absolute(self): + """Test that make from works if ResultMap has absolute paths + """ + results = ResultMap() + sample1_dir = os.path.join(self.resultdir, S1_NAME) + sample2_dir = os.path.join(self.resultdir, S2_NAME) + results['1000'] = sample1_dir + results['2000'] = sample2_dir + + results.make_tree_from(self.sourcedir, self.resultdir) + self.failUnless(os.path.isdir(sample1_dir)) + self.failUnless(os.path.isdir(sample2_dir)) + + for f in S1_FILES + S2_FILES: + self.failUnless( + os.path.islink( + os.path.join(self.resultdir, f))) + + def test_make_from_filename(self): + """Test that make from works if ResultMap has no path + """ results = ResultMap() results['1000'] = S1_NAME results['2000'] = S2_NAME results.make_tree_from(self.sourcedir, self.resultdir) - sample1_dir = os.path.join(self.resultdir, S1_NAME) sample2_dir = os.path.join(self.resultdir, S2_NAME) self.failUnless(os.path.isdir(sample1_dir)) @@ -97,5 +116,7 @@ def suite(): return suite if __name__ == "__main__": + import logging + logging.basicConfig(level=logging.DEBUG) from unittest2 import main main(defaultTest='suite')