Ejemplo n.º 1
0
    def setUp(self):
        """setUp and tearDown are run for teach test"""
        self.input_csv = os.path.join(os.path.dirname(__file__), '___valid_input.csv')
        with open(self.input_csv, 'wb') as opf1:
            opf1.write(
"""
GSE59813,GSM1446812;
GSE61491,GSM1506106; GSM1506107;
""")
        parser = rp_prep.get_parser()
        self.temp_outdir = tempfile.mkdtemp() # mkdtemp returns abspath
        self.options1 = parser.parse_args(['gen-csv', '-f', self.input_csv])
        self.options2 = parser.parse_args(['gen-csv', '-f', self.input_csv,
                                           '--outdir', self.temp_outdir])
        self.gse = 'GSE38003'
        self.gsm = 'GSM931711'
Ejemplo n.º 2
0
 def test_gen_outdir_with_specified_outdir(self, mock_mkdir):
     p = rp_prep.get_parser()
     options = p.parse_args(['gen-csv', '-f', 'any_dir/input.csv', '--outdir', 'specified_outdir'])
     self.assertEqual('specified_outdir', gen_csv.gen_outdir(options))        
     mock_mkdir.called_once_with('specified_outdir')
Ejemplo n.º 3
0
 def test_gen_outdir_without_specified_outdir(self, mock_mkdir):
     p = rp_prep.get_parser()
     options = p.parse_args(['gen-csv', '-f', 'any_dir/input.csv'])
     self.assertEqual('any_dir', gen_csv.gen_outdir(options))
     self.assertFalse(mock_mkdir.called, "mkdir shouldn't have been called with -f is specified")