Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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)
Пример #4
0
 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)
Пример #5
0
 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)
Пример #6
0
 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)