<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style data-externalstyle="true">
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}

p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst, p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle, p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
</style>
</head>
<body>
<div data-externalstyle="false" style="font-family:Calibri,'Segoe UI',Meiryo,'Microsoft YaHei UI','Microsoft JhengHei UI','Malgun Gothic','Khmer UI','Nirmala UI',Tunga,'Lao UI',Ebrima,sans-serif;font-size:16px;">
<div data-focusfrompointer="true">I'm a proponent of checking the exact code. To me, its part of the API contract. From a practical point, it has also helped our automated tests catch bugs that nearly slipped by. One case I an remember is when some various
 POSTs started returning a 200 code as opposed to a 202, with the end result being that the requests responded to with a 200 actually were not processed. The only reason I could think of to generalize response code checking would be if it the response codes
 were ever vendor configurable. </div>
<div data-signatureblock="true">
<div> </div>
<div data-focusfrompointer="true">Daryl</div>
<div> </div>
</div>
<div style="border-top-color: rgb(225, 225, 225); border-top-width: 1px; border-top-style: solid;">
<strong>From:</strong> David Kranz<br>
<strong>Sent:</strong> ‎January‎ ‎30‎, ‎2013 ‎4‎:‎08‎ ‎PM<br>
<strong>To:</strong> openstack-qa@lists.openstack.org<br>
<strong>Subject:</strong> [openstack-qa] Return codes for OpenStack APIs<br>
</div>
<div> </div>
There have been recent submissions to Tempest with code like:<br>
<br>
self.assertTrue(resp['status'].startswith('2'))<br>
<br>
It had been the consensus that we should be checking for actual status <br>
codes. Some projects document the return<br>
codes and others don't. This example was from a call to keystone to list <br>
services and the result is not documented but the list tenants<br>
calls says it could return 200 or 203. There should be a statement from <br>
each project about whether it considers the return code to be part of <br>
the spec.<br>
Ideally this would be uniform across projects but it is not. Users of <br>
the API really need to be able to know this. Any comments?<br>
<br>
   -David<br>
<br>
_______________________________________________<br>
openstack-qa mailing list<br>
openstack-qa@lists.openstack.org<br>
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-qa<br>
</div>
</body>
</html>