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.

75 lines
2.0 KiB

  1. # '''
  2. # Created on Jan 4, 2014
  3. #
  4. # @author: Chris
  5. #
  6. #
  7. #
  8. #
  9. # '''
  10. #
  11. # import os
  12. # import sys
  13. # import unittest
  14. # from argparse import ArgumentParser
  15. #
  16. # import wx
  17. #
  18. #
  19. # class ComponentsTest(unittest.TestCase):
  20. # def setUp(self):
  21. # parser = ArgumentParser(description='Example Argparse Program')
  22. # parser.add_argument("filename", help="Name of the file you want to read")
  23. # parser.add_argument('-T', '--tester', choices=['yes', 'no'])
  24. # parser.add_argument('-o', '--outfile', help='Redirects output to the specified file')
  25. # parser.add_argument('-v', '--verbose', help='Toggles verbosity off')
  26. # parser.add_argument('-e', '--repeat', action='count')
  27. # action = parser._actions
  28. # self.actions = {
  29. # 'help': action[0],
  30. # 'Positional': action[1],
  31. # 'Choice': action[2],
  32. # 'Optional': action[3],
  33. # 'Flag': action[4],
  34. # 'Counter': action[5]
  35. # }
  36. #
  37. #
  38. # def BuildWindow(self, component, _type):
  39. # app = wx.PySimpleApp()
  40. # module_name = os.path.split(sys.argv[0])[-1]
  41. # frame = wx.Frame(None, -1, _type)
  42. #
  43. # panel = wx.Panel(frame, -1, size=(320, 240))
  44. # component_sizer = component.Build(panel)
  45. # panel.SetSizer(component_sizer)
  46. #
  47. # frame.Show(True)
  48. #
  49. # app.MainLoop()
  50. #
  51. #
  52. # def testPositionalWidgetBuild(self):
  53. # self.SetupWidgetAndBuildWindow('Positional')
  54. #
  55. # def testChoiceWidgetBuild(self):
  56. # self.SetupWidgetAndBuildWindow('Choice')
  57. #
  58. # def testOptionalWidgetBuild(self):
  59. # self.SetupWidgetAndBuildWindow('Optional')
  60. #
  61. # def testFlagWidgetBuild(self):
  62. # self.SetupWidgetAndBuildWindow('Flag')
  63. #
  64. # def testCounterWidgetBuild(self):
  65. # self.SetupWidgetAndBuildWindow('Counter')
  66. #
  67. # def SetupWidgetAndBuildWindow(self, _type):
  68. # component = getattr(components, _type)(self.actions[_type])
  69. # self.BuildWindow(component, _type)
  70. #
  71. #
  72. # if __name__ == "__main__":
  73. # # import sys;sys.argv = ['', 'Test.testName']
  74. # unittest.main()
  75. #