Пример #1
0
 def test_iter(self):
     """Test iterator."""
     pyvlx = PyVLX()
     scenes = Scenes(pyvlx)
     scene1 = Scene(pyvlx, 0, "Scene_1")
     scenes.add(scene1)
     scene2 = Scene(pyvlx, 1, "Scene_2")
     scenes.add(scene2)
     scene3 = Scene(pyvlx, 2, "Scene_3")
     scenes.add(scene3)
     self.assertEqual(tuple(scenes.__iter__()), (scene1, scene2, scene3))
Пример #2
0
    def test_iter(self):
        """Test iterator."""
        pyvlx = PyVLX()
        scenes = Scenes(pyvlx)

        scene1 = Scene(pyvlx, 0, 'Scene_1')
        scenes.add(scene1)
        scene2 = Scene(pyvlx, 1, 'Scene_2')
        scenes.add(scene2)
        scene3 = Scene(pyvlx, 2, 'Scene_3')
        scenes.add(scene3)
        scene4 = Scene(pyvlx, 3, 'Scene_4')
        scenes.add(scene4)

        self.assertEqual(tuple(scenes.__iter__()),
                         (scene1, scene2, scene3, scene4))