diff options
Diffstat (limited to 'testapi/testapi-client/testapiclient/command.py')
-rw-r--r-- | testapi/testapi-client/testapiclient/command.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/testapi/testapi-client/testapiclient/command.py b/testapi/testapi-client/testapiclient/command.py index 2864f9a..62a8b86 100644 --- a/testapi/testapi-client/testapiclient/command.py +++ b/testapi/testapi-client/testapiclient/command.py @@ -14,6 +14,11 @@ class Command(command.Command): return parser + def show(self, request, response): + print ' '.join([request, + 'success' if response.status_code < 300 + else 'failed: {}'.format(response.text)]) + class Lister(command.Command): @@ -24,6 +29,10 @@ class Lister(command.Command): return query_url() if parsed_args.name else url + def show(self, response): + print response.json() if response.status_code < 300 else response.text + class ShowOne(command.Command): - pass + def show(self, response): + print response.json() if response.status_code < 300 else response.text |