> Question, why would you patch self.patch(self.ui, "focusInEvent", lambda ev:
> False) in the set_urgent test?
Doesn't seem necessary anymore. In a previous version of this, when you create the window, that widget got focus and focusInEvent removed the urgent flag. Will remove.
> Also, can we change this code:
>
> self.ui.switch_to("devices")
> self.assertEqual(
> self.ui.ui.control_panel.ui.tab_widget.currentIndex(),
> 2)
>
> to use something like:
>
> self.ui.switch_to("devices")
> self.assertEqual(
> self.ui.ui.control_panel.ui.tab_widget.currentIndex(),
> self.ui.ui.control_panel.ui.tab_widget.indexOf(self.ui.ui.control_
> panel.ui.devices))
>
> which in turn allows us to do something like:
>
> for tab_name in self.ui.tabs:
> tab = getattr(self.ui.ui.control_panel.ui, tab_name)
> self.ui.switch_to(tab_name)
> self.assertEqual(
> self.ui.ui.control_panel.ui.tab_widget.currentIndex(),
> self.ui.ui.control_panel.ui.tab_widget.indexOf(tab))
>
> What do you think?
It's a bit verbose, and it has a problem in that we don't want to test the tab switching in order, but something similar is doable.
> Question, why would you patch self.patch(self.ui, "focusInEvent", lambda ev:
> False) in the set_urgent test?
Doesn't seem necessary anymore. In a previous version of this, when you create the window, that widget got focus and focusInEvent removed the urgent flag. Will remove.
> Also, can we change this code: switch_ to("devices" ) ui.control_ panel.ui. tab_widget. currentIndex( ), switch_ to("devices" ) ui.control_ panel.ui. tab_widget. currentIndex( ), ui.control_ panel.ui. tab_widget. indexOf( self.ui. ui.control_ self.ui. ui.control_ panel.ui, tab_name) switch_ to(tab_ name) ui.control_ panel.ui. tab_widget. currentIndex( ), ui.control_ panel.ui. tab_widget. indexOf( tab))
>
> self.ui.
> self.assertEqual(
> self.ui.
> 2)
>
> to use something like:
>
> self.ui.
> self.assertEqual(
> self.ui.
> self.ui.
> panel.ui.devices))
>
> which in turn allows us to do something like:
>
> for tab_name in self.ui.tabs:
> tab = getattr(
> self.ui.
> self.assertEqual(
> self.ui.
> self.ui.
>
> What do you think?
It's a bit verbose, and it has a problem in that we don't want to test the tab switching in order, but something similar is doable.