From 90453a14944f3edf7c0babd33860b3699878860c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 3 Feb 2017 12:24:19 -0800 Subject: [PATCH] Add unittest for mustHaveApp checks --- unittests/test_mustHaveApp.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 unittests/test_mustHaveApp.py diff --git a/unittests/test_mustHaveApp.py b/unittests/test_mustHaveApp.py new file mode 100644 index 00000000..228e790b --- /dev/null +++ b/unittests/test_mustHaveApp.py @@ -0,0 +1,29 @@ +import unittest +import wx + + +#--------------------------------------------------------------------------- + +class TestMustHaveApp(unittest.TestCase): + + def test_mustHaveApp0(self): + """Test that an exception is raised if there is no app""" + with self.assertRaises(wx.PyNoAppError): + frame = wx.Frame(None) + frame.Close() + + + def test_mustHaveApp1(self): + """Create App and then create a frame""" + app = wx.App() + frame = wx.Frame(None) + frame.Show() + frame.Close() + app.MainLoop() + + +#--------------------------------------------------------------------------- + + +if __name__ == '__main__': + unittest.main()