1 from elisa.core.tests.component_test_case import ComponentTestCase
2 from elisa.plugins.good.xmlmenu.actions.viewimage_action import ViewimageAction
3
4 from weakref import ref
5
8
10
11 component_class = ViewimageAction
12
14
15 self.playlist = []
16 self.children = []
17 for uri in ('a', 'b', 'c'):
18 model = StupidModel()
19 model.uri = uri
20 self.children.append(model)
21
22 self.component.slideshow_model = self
23 self.component.parent_model = ref(self)
24 self.component.uri = 'b'
25
26 self.component(self, None)
27
28 self.assertEquals(self.playlist, ['a', 'b', 'c'])
29 self.assertEquals(self.current_index, 1)
30
31 self.component.uri = 'a'
32 self.component(self, None)
33
34 self.assertEquals(self.playlist, ['a', 'b', 'c'])
35 self.assertEquals(self.current_index, 0)
36