def test_get_component_by_name(self): m = self.model g1 = Gaussian() g2 = Gaussian() g2.name = "test" m.extend((g1, g2)) nose.tools.assert_is(m._get_component("test"), g2)
def test_access_component_by_index(self): m = self.model g1 = Gaussian() g2 = Gaussian() g2.name = "test" m.extend((g1, g2)) nose.tools.assert_is(m[1], g2)
def test_get_component_wrong(self): m = self.model g1 = Gaussian() g2 = Gaussian() g2.name = "test" m.extend((g1, g2)) m._get_component(1.2)
def test_get_component_by_component(self): m = self.model g1 = Gaussian() g2 = Gaussian() g2.name = "test" m.extend((g1, g2)) nose.tools.assert_is(m._get_component(g2), g2)