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.

20 lines
729 B

2 years ago
  1. import unittest
  2. from gooey.gui import cli
  3. class TestCliStringCreation(unittest.TestCase):
  4. # TODO: exercise the formValidationCase (which will require tedious test data creation)
  5. def test_cli(self):
  6. print(cli.buildCliString('target', 'cmd', ['pos1', 'pos2'], ['-a 1', '-b 2']))
  7. positionals = [
  8. {'clitype': 'positional', 'cmd': 'pos1', 'required': True},
  9. {'clitype': 'positional', 'cmd': 'pos2', 'required': True}
  10. ]
  11. optionals = [
  12. {'clitype': 'optional', 'cmd': '-a 1', 'required': False},
  13. {'clitype': 'optional', 'cmd': '-b 2', 'required': False},
  14. ]
  15. # print(cli.formValidationCmd('target', 'cmd', positionals, optionals))