Ejemplo n.º 1
0
    def test_add_species(self):
        species = Species('test_species')
        mixture = Mixture()
        mixture.add_species(species)

        # test that the new mixture only contain one species
        self.assertEqual([species], mixture.added_species)

        # adding invalid species
        with self.assertRaisesRegex(AssertionError,'only Species type is accepted!'):
            mixture.add_species(['ok', 'ok'])
Ejemplo n.º 2
0
    def test_add_species(self):
        from biocrnpyler import Mixture
        from biocrnpyler import Species

        species = Species('test_species')
        mixture = Mixture()
        mixture.add_species(species)

        self.assertEqual([species], mixture.added_species)

        with self.assertRaises(AssertionError):
            mixture.add_species(['ok', 'ok'])