def take_action(self, parsed_args): api = AtmosphereAPI(self.app_args.auth_token, base_url=self.app_args.base_url, timeout=self.app_args.api_server_timeout, verify=self.app_args.verify_cert) if parsed_args.delete: data = api.delete_volume(parsed_args.id) if data.ok and data.message and data.message != '': self.app.stdout.write('Volume deleted: {}\n'.format( data.message)) else: self.app.stdout.write('Volume deleted\n')
def test_deleting_volume_when_response_is_ok(self): api = AtmosphereAPI('token', base_url=self.mock_users_base_url) response = api.delete_volume(1) assert response.ok