def test_gen_gsm_html_with_already_existed_html(self, L): gse_dir = gen_csv.gen_gse_dir(self.temp_outdir, self.gse) gsm_html = os.path.join(gse_dir, '{0}.html'.format(self.gsm)) with open(gsm_html, 'wb') as opf: opf.write('') gen_csv.gen_gsm_html(self.temp_outdir, self.gse, self.gsm) L.check(('rsempipeline.preprocess.gen_csv', 'INFO', '{0} already downloaded'.format(gsm_html)))
def test_gen_gsm_html_with_invalid_gsm(self): html = gen_csv.gen_gsm_html(self.temp_outdir, self.gse, 'invalid_GSM12345') self.assertTrue(os.path.exists(html)) with open(html) as inf: content = inf.read() self.assertIn('Type in the a valid GEO accession number in the text box above', content) self.assertNotIn(self.gse, content)
def test_gen_gsm_html(self, L): html = gen_csv.gen_gsm_html(self.temp_outdir, self.gse, self.gsm) self.assertTrue(os.path.exists(html)) with open(html) as inf: self.assertIn(self.gse, inf.read()) L.check(('rsempipeline.preprocess.gen_csv', 'INFO', 'downloading {0}'.format(html)))