Example #1
0
 def test_get_ids_simple_fna_only_neither_present(self):
     with mock.patch('os.listdir') as mocked_listdir:
         mocked_listdir.return_value = []
         with self.assertRaisesRegex(
                 ValueError, r'Cannot gunzip when .gz '
                 r'file is not present'):
             _get_ids_not_downloaded(['Assembly_A'],
                                     self.genomes_metadata,
                                     self.genomes_directory,
                                     to_unzip=True)
Example #2
0
 def test_get_ids_simple(self):
     with mock.patch('os.listdir') as mocked_listdir:
         mocked_listdir.return_value = ['id_B_genomic.fna.gz']
         returned_ids = _get_ids_not_downloaded(self.id_list,
                                                self.genomes_metadata,
                                                self.genomes_directory)
     self.assertCountEqual(returned_ids, ['Assembly_A'])
Example #3
0
 def test_get_ids_simple_fna_only_fna_present(self):
     with mock.patch('os.listdir') as mocked_listdir:
         mocked_listdir.return_value = ['id_A_genomic.fna']
         returned_ids = _get_ids_not_downloaded(['Assembly_A'],
                                                self.genomes_metadata,
                                                self.genomes_directory,
                                                to_unzip=True)
     self.assertCountEqual(returned_ids, [])