(self)
| 77 | } |
| 78 | |
| 79 | def test_json_response(self): |
| 80 | output = self.run_cmd('iam list-users', expected_rc=0)[0] |
| 81 | parsed_output = json.loads(output) |
| 82 | self.assertIn('Users', parsed_output) |
| 83 | self.assertEqual(len(parsed_output['Users']), 2) |
| 84 | self.assertEqual( |
| 85 | sorted(parsed_output['Users'][0].keys()), |
| 86 | ['Arn', 'CreateDate', 'Path', 'UserId', 'UserName'], |
| 87 | ) |
| 88 | |
| 89 | def test_jmespath_json_response(self): |
| 90 | jmespath_query = 'Users[*].UserName' |