<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:宋体;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML 预设格式 Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:宋体;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"批注框文本 Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:9.0pt;
font-family:宋体;}
span.HTMLChar
{mso-style-name:"HTML 预设格式 Char";
mso-style-priority:99;
mso-style-link:"HTML 预设格式";
font-family:"Courier New";}
span.Char
{mso-style-name:"批注框文本 Char";
mso-style-priority:99;
mso-style-link:批注框文本;
font-family:宋体;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ZH-CN" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi, Khayam,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">Could you paste your whole file for test cases and the source code to be tested in the
<a href="http://paste.openstack.org/">http://paste.openstack.org/</a> seperatly.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">Please share the links, so that to find out what happened.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">Best Regards<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">Chaoyi Huang ( Joe Huang )</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Khayam Gondal [mailto:khayam.gondal@gmail.com]
<br>
<b>Sent:</b> Thursday, April 14, 2016 5:30 PM<br>
<b>To:</b> joehuang<br>
<b>Cc:</b> OpenStack Development Mailing List (not for usage questions); Zhiyuan Cai<br>
<b>Subject:</b> Re: [Tricircle] Error runnig py27<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">Hi joehuang,<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">by removing self it is showing following error.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US"> File "/home/khayam/tricircle/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 1206, in _importer<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> thing = __import __ (import_path)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Import Error: No module named app<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Ran 135 tests in 2.994s (+ 0.940s)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">On Thu, Apr 14, 2016 at 5:53 AM, joehuang <<a href="mailto:joehuang@huawei.com" target="_blank">joehuang@huawei.com</a>> wrote:<o:p></o:p></span></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">Hi, Khayam,
</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">@</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#0000B2">mock.patch</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">(</span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:green">'self.app.post_json'</span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">)</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">No “self.” needed.</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify;text-justify:inter-ideograph">
<span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">Best Regards</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:justify;text-justify:inter-ideograph">
<span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D">Chaoyi Huang ( Joe Huang )</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Khayam
Gondal [mailto:<a href="mailto:khayam.gondal@gmail.com" target="_blank">khayam.gondal@gmail.com</a>]
<br>
<b>Sent:</b> Wednesday, April 13, 2016 2:50 PM<br>
<b>To:</b> OpenStack Development Mailing List (not for usage questions)<br>
<b>Cc:</b> joehuang; Zhiyuan Cai<br>
<b>Subject:</b> [Tricircle] Error runnig py27</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Hi I am writing a test for exception . Following is my testing function.<o:p></o:p></span></p>
<div>
<pre><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">@</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#0000B2">mock.patch</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">(</span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:green">'self.app.post_json'</span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">)<br></span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:navy">def </span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">test_post_exp(</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#94558D">self</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">, mock_get, mock_http_error_handler):<br><br> mock_response = mock.Mock()<br> mock_response.raise_for_status.side_effect = db_exc.DBDuplicateEntry<br> mock_get.return_value = mock_response<br> mock_http_error_handler.side_effect = db_exc.DBDuplicateEntry<br> </span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:navy">with </span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#94558D">self</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">.assertRaise(db_exc.DBDuplicateEntry):<br> </span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#94558D">self</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">.app.post_json(<br> </span><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:green">'/v1.0/pods'</span></b><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">,<br> </span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:navy">dict</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">(</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#660099">pod</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">=</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:navy">None</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">),<br> </span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#660099">expect_errors</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">=</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:navy">True</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:black">)</span><span lang="EN-US"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-family:"Arial","sans-serif";color:#222222">But when I run tox -epy27 it shows: </span><span lang="EN-US"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-family:"Arial","sans-serif""> <b> File "/home/khayam/tricircle/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 1206, in _importer</b></span><span lang="EN-US"><o:p></o:p></span></pre>
<pre><b><span lang="EN-US" style="font-family:"Arial","sans-serif""> thing = __import__(import_path)</span></b><span lang="EN-US"><o:p></o:p></span></pre>
<pre><b><span lang="EN-US" style="font-family:"Arial","sans-serif"">ImportError: No module named self</span></b><span lang="EN-US"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="font-family:"Arial","sans-serif"">Can someone guide me whats wrong here. I already had installed latest version of mock, python-dev. </span><span lang="EN-US"><o:p></o:p></span></pre>
<div>
<pre><span lang="EN-US" style="font-family:"Arial","sans-serif";color:#222222"> </span><span lang="EN-US"><o:p></o:p></span></pre>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</div>
</body>
</html>