Beispiel #1
0
 def test_get_sequence_count_file_has_zero_size(self):
     temp_dir = tempfile.mkdtemp()
     try:
         params = D3RParameters()
         task = MakeBlastDBTask(temp_dir, params)
         task.create_dir()
         open(task.get_pdb_seqres_txt(), 'a').close()
         self.assertEqual(task._get_sequence_count_message(),
                          '# sequence(s): 0')
     finally:
         shutil.rmtree(temp_dir)
Beispiel #2
0
 def test_get_sequence_count_file_has_multiple_seqs(self):
     temp_dir = tempfile.mkdtemp()
     try:
         params = D3RParameters()
         task = MakeBlastDBTask(temp_dir, params)
         task.create_dir()
         f = open(task.get_pdb_seqres_txt(), 'w')
         f.write('>hi\n>seq\n>are\n')
         f.flush()
         f.close()
         self.assertEqual(task._get_sequence_count_message(),
                          '# sequence(s): 3')
     finally:
         shutil.rmtree(temp_dir)
Beispiel #3
0
    def test_get_sequence_count_no_file(self):
        params = D3RParameters()
        task = MakeBlastDBTask('/foo', params)

        self.assertEqual(task._get_sequence_count_message(),
                         '# sequence(s): Error unable to parse file')