def test_samtools_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.samtools_index(['foo']) self.assertEqual(version_mock.call_count, 1) self.assertEqual(version_mock.call_args[0][0], ['samtools']) self.assertEqual(run_mock.call_count, 1) run_mock.assert_called_once_with(['samtools', 'faidx', 'foo'])
def test_samtools_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.samtools_index(['foo']) self.assertEqual(version_mock.call_count, 1) self.assertEqual(version_mock.call_args[0][0], ['samtools']) self.assertEqual(run_mock.call_count, 1) run_mock.assert_called_once_with(['samtools', 'faidx', 'foo'])
def test_samtools_index_with_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': '/usr/bin/samtools'}.get slurm_srst2.samtools_index(['foo']) self.assertEqual(version_mock.call_count, 1) self.assertEqual(version_mock.call_args[0][0], ['/usr/bin/samtools']) self.assertEqual(run_mock.call_count, 1) run_mock.assert_called_once_with(['/usr/bin/samtools', 'faidx', 'foo'])
def test_samtools_index_with_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': '/usr/bin/samtools'}.get slurm_srst2.samtools_index(['foo']) self.assertEqual(version_mock.call_count, 1) self.assertEqual(version_mock.call_args[0][0], ['/usr/bin/samtools']) self.assertEqual(run_mock.call_count, 1) run_mock.assert_called_once_with(['/usr/bin/samtools', 'faidx', 'foo'])