Beispiel #1
0
    def test_fromSpeciesAndName_TbWithValidPanel_returnsPanel(self):
        species = Species.TB
        name = "201901"
        panel = Panel.from_species_and_name(species, name)

        actual = panel.name
        expected = TbPanel.NEJM_WALKER

        assert actual == expected
Beispiel #2
0
    def test_fromSpeciesAndName_staphWithCustomPanel_returnsCustom(self):
        species = Species.STAPH
        name = "custom"
        panel = Panel.from_species_and_name(species, name)

        actual = panel.name
        expected = StaphPanel.CUSTOM

        assert actual == expected
Beispiel #3
0
    def test_add_single_path(self):
        species = Species.TB
        name = "201901"
        panel = Panel.from_species_and_name(species, name)
        additions = "foo"
        panel.add_path(*additions)

        actual = panel.paths
        expected = PANELS[species][panel.name]
        expected.append(additions)

        assert actual == expected
Beispiel #4
0
    def test_add_multiple_paths(self):
        species = Species.TB
        name = "201901"
        panel = Panel.from_species_and_name(species, name)
        additions = ["foo", "bar"]
        panel.add_path(*additions)

        actual = panel.paths
        expected = PANELS[species][panel.name]
        expected.extend(additions)

        assert actual == expected
Beispiel #5
0
 def test_fromSpeciesAndName_staphWithInvalidPanel_raisesError(self):
     species = Species.STAPH
     name = "bar"
     with pytest.raises(ValueError):
         Panel.from_species_and_name(species, name)
Beispiel #6
0
 def test_fromSpeciesAndName_invalidSpecies_raisesError(self):
     species = "foo"
     name = "bar"
     with pytest.raises(NameError):
         Panel.from_species_and_name(species, name)