diff options
author | thuva4 <tharma.thuva@gmail.com> | 2018-04-29 17:40:00 +0530 |
---|---|---|
committer | thuva4 <tharma.thuva@gmail.com> | 2018-05-07 11:08:10 +0530 |
commit | f10eff1ad885457a004f4a2d4b8dab3d6c0841c2 (patch) | |
tree | 1e6b6b19b9c6b031d28d45e91e75c4cf1bfced28 | |
parent | 71c429c25f30660d436fef7b064553c266d4655a (diff) |
Add project model in testapiclient
Change-Id: If238e2d22f3c895264c90579c7c4d0b442f6c82a
Signed-off-by: thuva4 <tharma.thuva@gmail.com>
-rw-r--r-- | testapi/testapi-client/testapiclient/cli/projects.py | 15 | ||||
-rw-r--r-- | testapi/testapi-client/testapiclient/models/project.py | 4 |
2 files changed, 13 insertions, 6 deletions
diff --git a/testapi/testapi-client/testapiclient/cli/projects.py b/testapi/testapi-client/testapiclient/cli/projects.py index 510acc8..2fa5b5b 100644 --- a/testapi/testapi-client/testapiclient/cli/projects.py +++ b/testapi/testapi-client/testapiclient/cli/projects.py @@ -2,6 +2,7 @@ import json from testapiclient.utils import command from testapiclient.utils import urlparse +from testapiclient.models import project def projects_url(): @@ -51,9 +52,10 @@ class ProjectCreate(command.ShowOne): parser = super(ProjectCreate, self).get_parser(prog_name) parser.add_argument('project', type=json.loads, - help='Project create request format :{' - ' "name": (required)"", ' - '"description": (optional)""}') + help='Project create request format :\n' + '\'{}\''.format(json.dumps( + project.ProjectCreateRequest().__dict__ + ))) return parser def take_action(self, parsed_args): @@ -83,9 +85,10 @@ class ProjectPut(command.ShowOne): help='Update project by name') parser.add_argument('project', type=json.loads, - help='Project Update request format :{' - '"name": (required)"", ' - '"description": (optional)""}') + help='Project Update request format :\n' + '\'{}\''.format(json.dumps( + project.ProjectCreateRequest().__dict__ + ))) return parser def take_action(self, parsed_args): diff --git a/testapi/testapi-client/testapiclient/models/project.py b/testapi/testapi-client/testapiclient/models/project.py new file mode 100644 index 0000000..fc85588 --- /dev/null +++ b/testapi/testapi-client/testapiclient/models/project.py @@ -0,0 +1,4 @@ +class ProjectCreateRequest(): + def __init__(self, name='', description=''): + self.description = description + self.name = name |