Esempio n. 1
0
    def test_none_prefix(self):
        """Should raise an exception when None is used as the prefix"""

        with self.assertRaises(TypeError):
            grapple.read_alignment(self._test_file,
                                   self._ref_file,
                                   prefix_id=None)
Esempio n. 2
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.read_alignment(self._test_file,
                                   self._ref_file,
                                   prefix_id=0)
Esempio n. 3
0
    def test_valid_files(self):
        """Should not raise an exception when valid files are given as input"""

        try:
            grapple.read_alignment(self._test_file, self._ref_file)

        except Exception as e:
            self.fail(e)
Esempio n. 4
0
    def test_valid_files(self):
        """Should not raise an exception when valid files are given as input"""

        try:
            grapple.read_alignment(self._test_file, self._ref_file)

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

        with self.assertRaises(TypeError):
            grapple.read_alignment(self._test_file, self._ref_file, prefix_id=None)
Esempio n. 6
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.read_alignment(self._test_file, self._ref_file, prefix_id=0)
Esempio n. 7
0
    def test_none_ref_file(self):
        """Should raise an exception when None is given as the reference file"""

        with self.assertRaises(AttributeError):
            grapple.read_alignment(self._test_file, None)
Esempio n. 8
0
    def test_absent_ref_file(self):
        """Should raise an exception when the reference file doesn't exist"""

        with self.assertRaises(CalledProcessError):
            grapple.read_alignment(self._test_file, 'this_file_does_not_exist.fa')
Esempio n. 9
0
    def test_invalid_ref_file(self):
        """Should raise an exception when the reference file is in the wrong format"""

        with self.assertRaises(ValueError):
            grapple.read_alignment(self._test_file, self._test_file)
Esempio n. 10
0
    def test_none_read_file(self):
        """Should raise an exception when None is passed as the read_file"""

        with self.assertRaises(AttributeError):
            grapple.read_alignment(None, self._ref_file)
Esempio n. 11
0
    def test_absent_read_file(self):
        """Should raise an exception when the read file is absent"""

        with self.assertRaises(CalledProcessError):
            grapple.read_alignment('this_file_does_not_exist.fq', self._ref_file)
Esempio n. 12
0
    def test_none_ref_file(self):
        """Should raise an exception when None is given as the reference file"""

        with self.assertRaises(AttributeError):
            grapple.read_alignment(self._test_file, None)
Esempio n. 13
0
    def test_absent_ref_file(self):
        """Should raise an exception when the reference file doesn't exist"""

        with self.assertRaises(CalledProcessError):
            grapple.read_alignment(self._test_file,
                                   'this_file_does_not_exist.fa')
Esempio n. 14
0
    def test_invalid_ref_file(self):
        """Should raise an exception when the reference file is in the wrong format"""

        with self.assertRaises(ValueError):
            grapple.read_alignment(self._test_file, self._test_file)
Esempio n. 15
0
    def test_none_read_file(self):
        """Should raise an exception when None is passed as the read_file"""

        with self.assertRaises(AttributeError):
            grapple.read_alignment(None, self._ref_file)
Esempio n. 16
0
    def test_absent_read_file(self):
        """Should raise an exception when the read file is absent"""

        with self.assertRaises(CalledProcessError):
            grapple.read_alignment('this_file_does_not_exist.fq',
                                   self._ref_file)