Exemplo n.º 1
0
	def test_bowtie_index_with_default(self, env_mock, path_mock, run_mock,
										 version_mock, stdout_mock):
		path_mock.exists.return_value = False
		env_mock.get.return_value = None
		slurm_srst2.bowtie_index(['foo'])
		self.assertEqual(version_mock.call_count, 1)
		self.assertEqual(version_mock.call_args[0][0], ['bowtie2',
														'--version'])
		self.assertEqual(run_mock.call_count, 1)
		run_mock.assert_called_once_with(['bowtie2-build', 'foo', 'foo'])
Exemplo n.º 2
0
 def test_bowtie_index_with_default(self, env_mock, path_mock, run_mock,
                                    version_mock, stdout_mock):
     path_mock.exists.return_value = False
     env_mock.get.return_value = None
     slurm_srst2.bowtie_index(['foo'])
     self.assertEqual(version_mock.call_count, 1)
     self.assertEqual(version_mock.call_args[0][0],
                      ['bowtie2', '--version'])
     self.assertEqual(run_mock.call_count, 1)
     run_mock.assert_called_once_with(['bowtie2-build', 'foo', 'foo'])
Exemplo n.º 3
0
	def test_bowtie_index_with_partial_overide(self, env_mock, path_mock, run_mock,
											   version_mock, stdout_mock):
		path_mock.exists.return_value = False
		path_mock.isfile.side_effect = lambda f: 'missing' not in f
		fake_env_variables = {'SRST2_BOWTIE2': '/usr/bin/bowtie2'}
		env_mock.get.side_effect = fake_env_variables.get
		slurm_srst2.bowtie_index(['foo'])
		self.assertEqual(version_mock.call_count, 1)
		self.assertEqual(version_mock.call_args[0][0], ['/usr/bin/bowtie2',
														'--version'])
		self.assertEqual(run_mock.call_count, 1)
		run_mock.assert_called_once_with(['/usr/bin/bowtie2-build', 'foo', 'foo'])
Exemplo n.º 4
0
	def test_bowtie_index_with_missing_overide(self, env_mock, path_mock,
												 run_mock, version_mock,
												 stdout_mock):
		path_mock.exists.return_value = False
		path_mock.isfile.side_effect = lambda f: 'missing' not in f
		env_mock.get.side_effect = {'SRST2_SAMTOOLS': '/missing/bowtie'}.get
		slurm_srst2.bowtie_index(['foo'])
		self.assertEqual(version_mock.call_count, 1)
		self.assertEqual(version_mock.call_args[0][0], ['bowtie2',
														'--version'])
		self.assertEqual(run_mock.call_count, 1)
		run_mock.assert_called_once_with(['bowtie2-build', 'foo', 'foo'])
Exemplo n.º 5
0
 def test_bowtie_index_with_missing_overide(self, env_mock, path_mock,
                                            run_mock, version_mock,
                                            stdout_mock):
     path_mock.exists.return_value = False
     path_mock.isfile.side_effect = lambda f: 'missing' not in f
     env_mock.get.side_effect = {'SRST2_SAMTOOLS': '/missing/bowtie'}.get
     slurm_srst2.bowtie_index(['foo'])
     self.assertEqual(version_mock.call_count, 1)
     self.assertEqual(version_mock.call_args[0][0],
                      ['bowtie2', '--version'])
     self.assertEqual(run_mock.call_count, 1)
     run_mock.assert_called_once_with(['bowtie2-build', 'foo', 'foo'])
Exemplo n.º 6
0
 def test_bowtie_index_with_missing_inference(self, env_mock, path_mock,
                                              run_mock, version_mock,
                                              stdout_mock):
     path_mock.exists.return_value = False
     path_mock.isfile.side_effect = lambda f: f == '/usr/bin/bowtie2'
     fake_env_variables = {'SRST2_BOWTIE2': '/usr/bin/bowtie2'}
     env_mock.get.side_effect = fake_env_variables.get
     slurm_srst2.bowtie_index(['foo'])
     self.assertEqual(version_mock.call_count, 1)
     self.assertEqual(version_mock.call_args[0][0],
                      ['/usr/bin/bowtie2', '--version'])
     self.assertEqual(run_mock.call_count, 1)
     run_mock.assert_called_once_with(['bowtie2-build', 'foo', 'foo'])