class TestPanViewWidget(object): image_set = PDSSpectImageSet([FILE_1]) pan = PanView(image_set) @pytest.fixture def pan_widget(self): reset_image_set(self.image_set) self.pan = PanView(self.image_set) return PanViewWidget(self.pan, None) def test_init(self, pan_widget): assert len(pan_widget.pans) == 1 assert pan_widget.pans[0] == self.pan assert pan_widget.main_layout.itemAt(0).widget() == self.pan def test_add_pan(self, pan_widget): subset = SubPDSSpectImageSet(self.image_set) pan2 = PanView(subset) pan_widget.add_pan(pan2) assert pan_widget.pans[1] == pan2 assert pan_widget.main_layout.itemAt(1).widget() == pan2
def test_add_pan(self, pan_widget): subset = SubPDSSpectImageSet(self.image_set) pan2 = PanView(subset) pan_widget.add_pan(pan2) assert pan_widget.pans[1] == pan2 assert pan_widget.main_layout.itemAt(1).widget() == pan2
def pan_widget(self): reset_image_set(self.image_set) self.pan = PanView(self.image_set) return PanViewWidget(self.pan, None)
def view(self, qtbot): reset_image_set(self.image_set) view = PanView(self.image_set) view.show() qtbot.add_widget(view) return view