Пример #1
0
 def test_args(self):
     parser = argparse.ArgumentParser()
     # For validation
     subparsers = parser.add_subparsers(dest='command')
     validate_parser = subparsers.add_parser(
         'validate', help='validate a commit')
     validate.add_arguments(validate_parser)
Пример #2
0
 def test_args(self):
     parser = argparse.ArgumentParser()
     # For validation
     subparsers = parser.add_subparsers(dest='command')
     validate_parser = subparsers.add_parser('validate',
                                             help='validate a commit')
     validate.add_arguments(validate_parser)
Пример #3
0
import monkeypatch  # noqa
import argparse
from tsampi import validate, utils
import sys


parser = argparse.ArgumentParser()
# parser.add_argument('--format', help='How the output should be formated', choices=['json', 'text'], default='text')

# For validation
subparsers = parser.add_subparsers(dest='command')
validate_parser = subparsers.add_parser('validate', help='validate a commit')

# let the validator add it's own arguments
validate.add_arguments(validate_parser)

app_parser = subparsers.add_parser('apps', help='apps')
utils.add_arguments(app_parser)

args = parser.parse_args()


if args.command == 'validate':
    result = validate.run(parser)

if args.command == 'apps':
    utils.run(parser)
Пример #4
0
import monkeypatch  # noqa
import argparse
from tsampi import validate, utils

parser = argparse.ArgumentParser()
# parser.add_argument('--format', help='How the output should be formated', choices=['json', 'text'], default='text')

# For validation
subparsers = parser.add_subparsers(dest='command')
validate_parser = subparsers.add_parser('validate', help='validate a commit')

# let the validator add it's own arguments
validate.add_arguments(validate_parser)

app_parser = subparsers.add_parser('apps', help='apps')
utils.add_arguments(app_parser)

args = parser.parse_args()

if args.command == 'validate':
    validate.run(parser)

if args.command == 'apps':
    utils.run(parser)