You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.4 KiB

  1. import time
  2. import unittest
  3. from tests.integration.programs import validations as validations_module
  4. class TestGooeyIntegration(unittest.TestCase):
  5. """
  6. A few quick integration tests that exercise Gooey's various run modes
  7. WX Python needs to control the main thread. So, in order to simulate a user
  8. running through the system, we have to execute the actual assertions in a
  9. different thread
  10. """
  11. def test__gooeyValidation(self):
  12. """Verifies that custom validation routines supplied via gooey_options prevents
  13. the user from advancing past the configuration page when they fail"""
  14. from gooey.tests.integration import runner
  15. runner.run_integration(validations_module, self.verifyValidators)
  16. def verifyValidators(self, app, buildSpec):
  17. time.sleep(1)
  18. try:
  19. app.TopWindow.onStart()
  20. title = app.TopWindow.header._header.GetLabel()
  21. subtitle = app.TopWindow.header._subheader.GetLabel()
  22. self.assertNotEqual(title, buildSpec['program_name'])
  23. self.assertNotEqual(subtitle, buildSpec['program_description'])
  24. except:
  25. app.TopWindow.Destroy()
  26. raise
  27. else:
  28. import wx
  29. wx.CallAfter(app.TopWindow.Destroy)
  30. return None
  31. if __name__ == '__main__':
  32. unittest.main()