def test_select_from_list_of_strings( self ): list_of_tuples = [ ( 'a', 123 ), ( 'b', 456 ), ( 'c', 789 ) ] with ClientGUIDialogs.DialogSelectFromList( None, 'select from a list of strings', list_of_tuples ) as dlg: ClientThreading.CallLater( self, 0.5, dlg._list.Select, 1 ) ClientThreading.CallLater( self,1, PressKey, dlg._list, wx.WXK_RETURN ) result = dlg.ShowModal() self.assertEqual( result, wx.ID_OK ) value = dlg.GetChoice() self.assertEqual( value, 456 )
def test_dialog_manage_subs( self ): HG.test_controller.SetRead( 'serialisable_named', [] ) title = 'subs test' with ClientGUITopLevelWindows.DialogManage( None, title ) as dlg: panel = ClientGUIScrolledPanelsManagement.ManageSubscriptionsPanel( dlg ) dlg.SetPanel( panel ) ClientThreading.CallLater( dlg, 2, panel.Add ) ClientThreading.CallLater( dlg, 4, OKChildDialog, panel ) ClientThreading.CallLater( dlg, 6, HitCancelButton, dlg ) result = dlg.ShowModal() self.assertEqual( result, wx.ID_CANCEL )