LOG = get_loggers(__name__) ARG_LIST = ArgumentList([ ModelVersionID(), ParentLocationID(), SexID(), DmCommands(), DmOptions(), BoolArg('--fill', help='whether or not to fill the dismod database with data'), BoolArg( '--prior-samples', help='whether or not the prior came from samples or just a mean fit'), IntArg( '--prior-parent', help='the location ID of the parent database to grab the prior for'), IntArg('--prior-sex', help='the sex ID of the parent database to grab prior for'), IntArg('--prior-mulcov', help='the model version id where mulcov stats is passed in', required=False), BoolArg('--save-fit', help='whether or not to save the fit'), BoolArg('--save-prior', help='whether or not to save the prior'), LogLevel(), StrArg('--test-dir', help='if set, will save files to the directory specified') ]) class DismodDBError(CascadeATError):
def test_int_arg(): a = IntArg() assert a._parser_kwargs['type'] == int
def test_argument_list_task_args(): arg1 = IntArg('--foo') al = ArgumentList([arg1, ModelVersionID()]) assert al.task_args == ['model_version_id'] assert al.node_args == ['foo']
def test_argument_list(): al = ArgumentList([IntArg('--foo'), BoolArg('--bar')]) args = al.parse_args('--foo 1 --bar'.split()) assert args.foo == 1 assert args.bar
def test_argument_list_template(): al = ArgumentList([IntArg('--foo-bar'), BoolArg('--bar')]) assert al.template == '{foo_bar} {bar}'