Coverage for tests/unit/lib/ui/test_dialogs.py: 100%

20 statements  

« prev     ^ index     » next       coverage.py v7.4.4, created at 2024-03-20 05:56 +0000

1import os 

2 

3import wx 

4from tatlin.lib.ui.dialogs import AboutDialog, OpenDialog, OpenErrorAlert, QuitDialog 

5from tatlin.lib.util import resolve_path 

6from tests.guitestcase import GUITestCase 

7 

8 

9class DialogsTest(GUITestCase): 

10 def test_open_dialog(self): 

11 dlg = OpenDialog(self.frame, os.getcwd()) 

12 wx.CallLater(250, dlg.EndModal, wx.ID_CANCEL) 

13 dlg.get_path() 

14 dlg.get_type() 

15 dlg.Destroy() 

16 

17 def test_quit_dialog(self): 

18 dlg = QuitDialog(self.frame) 

19 wx.CallLater(250, dlg.EndModal, wx.ID_SAVE) 

20 dlg.show() 

21 dlg.Destroy() 

22 

23 def test_about_dialog(self): 

24 icon = wx.Icon(resolve_path("tatlin.png"), wx.BITMAP_TYPE_PNG) 

25 about = AboutDialog("1.0", icon, "")