Esempio n. 1
0
    def test_valid_file(self):
        """Should not raise an exception when a valid file is provided"""

        try:
            grapple.sort_and_index(self._test_file)

        except Exception as e:
            self.fail(e)
Esempio n. 2
0
    def test_valid_file(self):
        """Should not raise an exception when a valid file is provided"""

        try:
            grapple.sort_and_index(self._test_file)

        except Exception as e:
            self.fail(e)
Esempio n. 3
0
    def test_none_prefix(self):
        """Should raise an exception when None is used as the prefix"""

        with self.assertRaises(TypeError):
            grapple.sort_and_index(self._test_file, prefix_id=None)
Esempio n. 4
0
    def test_bad_prefix(self):
        """Should raise an exception when a type that cannot be converted to a string is given for the prefix"""

        with self.assertRaises(TypeError):
            grapple.sort_and_index(self._test_file, prefix_id=0)
Esempio n. 5
0
    def test_none_file(self):
        """Should raise an exception when None is passed as the read file"""

        with self.assertRaises(AttributeError):
            grapple.sort_and_index(None)
Esempio n. 6
0
    def test_absent_file(self):
        """Should raise an exception when a read file does not exist"""

        with self.assertRaises(CalledProcessError):
            grapple.sort_and_index('this_file_does_not_exist.bam')
Esempio n. 7
0
    def test_invalid_file(self):
        """Should raise an exception when a file with the wrong format is used"""

        with self.assertRaises(ValueError):
            grapple.sort_and_index(os.path.join('test_files', 'lambda_ref.fa'))
Esempio n. 8
0
    def test_none_prefix(self):
        """Should raise an exception when None is used as the prefix"""

        with self.assertRaises(TypeError):
            grapple.sort_and_index(self._test_file, prefix_id=None)
Esempio n. 9
0
    def test_bad_prefix(self):
        """Should raise an exception when a type that cannot be converted to a string is given for the prefix"""

        with self.assertRaises(TypeError):
            grapple.sort_and_index(self._test_file, prefix_id=0)
Esempio n. 10
0
    def test_none_file(self):
        """Should raise an exception when None is passed as the read file"""

        with self.assertRaises(AttributeError):
            grapple.sort_and_index(None)
Esempio n. 11
0
    def test_absent_file(self):
        """Should raise an exception when a read file does not exist"""

        with self.assertRaises(CalledProcessError):
            grapple.sort_and_index('this_file_does_not_exist.bam')
Esempio n. 12
0
    def test_invalid_file(self):
        """Should raise an exception when a file with the wrong format is used"""

        with self.assertRaises(ValueError):
            grapple.sort_and_index(os.path.join('test_files', 'lambda_ref.fa'))