<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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Calibri;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
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;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.gmailmsg
{mso-style-name:gmail_msg;}
p.m5306597561535435383msolistparagraph, li.m5306597561535435383msolistparagraph, div.m5306597561535435383msolistparagraph
{mso-style-name:m_5306597561535435383msolistparagraph;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
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="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Yes. We actually had to remove the regex generation support a few months ago, since the python package we were using – exrex – was not one that OpenStack supported.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Yujun Zhang [mailto:zhangyujun+zte@gmail.com]
<br>
<b>Sent:</b> Tuesday, December 13, 2016 8:32 AM<br>
<b>To:</b> OpenStack Development Mailing List (not for usage questions) <openstack-dev@lists.openstack.org><br>
<b>Subject:</b> Re: [openstack-dev] [vitrage] how to use mock driver<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Elisha, thanks for the explanation. The difference is clear to me now.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">If I understand it correctly, the regular expression in spec JSON is for information only. It is never compiled into a `re` object.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The actual values are generated in `static_info_parsers` from the `mapping`. The regular expression is neither used as a value template nor for value validation.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Is that right?<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Mon, Dec 12, 2016 at 8:47 PM Rosensweig, Elisha (Nokia - IL) <<a href="mailto:elisha.rosensweig@nokia.com">elisha.rosensweig@nokia.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="gmailmsg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Hi,</span></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="gmailmsg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span></span><o:p></o:p></p>
<p class="m5306597561535435383msolistparagraph"><span class="gmailmsg"><span style="font-size:11.0pt;font-family:Symbol">·</span></span><span class="gmailmsg"><span style="font-size:7.0pt">
</span></span><span class="gmailmsg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">In Vitrage Datasources, we can have a different input format for snapshots and updates. Thus, we need a different JSON file for each.</span></span><o:p></o:p></p>
<p class="m5306597561535435383msolistparagraph"><span class="gmailmsg"><span style="font-size:11.0pt;font-family:Symbol">·</span></span><span class="gmailmsg"><span style="font-size:7.0pt">
</span></span><span class="gmailmsg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Also, as part of the Mock feature, we need to support (for each resource) things that will be static, such as it’s name, and things that change over time, such
as timestamps. We support this partially via different JSON files. In general, the dynamic file (marked with “D”)
<u>overwrites</u> the static one (marked with “S”).</span></span><o:p></o:p></p>
<p class="m5306597561535435383msolistparagraph"><span class="gmailmsg"><span style="font-size:11.0pt;font-family:Symbol">·</span></span><span class="gmailmsg"><span style="font-size:7.0pt">
</span></span><span class="gmailmsg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">In the code you can further inject specific fields you want to have for a specific test, in addition to the JSON files. See examples in test_scenario_evaluator.py.</span></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="gmailmsg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="gmailmsg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Elisha</span></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="gmailmsg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class="gmailmsg"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b></span><span class="gmailmsg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">
Yujun Zhang [mailto:<a href="mailto:zhangyujun%2Bzte@gmail.com" target="_blank">zhangyujun+zte@gmail.com</a>]
</span></span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><br>
<span class="gmailmsg"><b>Sent:</b> Monday, December 12, 2016 8:23 AM</span><br>
<span class="gmailmsg"><b>To:</b> OpenStack Development Mailing List (not for usage questions) <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>></span><br>
<span class="gmailmsg"><b>Subject:</b> [openstack-dev] [vitrage] how to use mock driver</span></span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Is there any documentation on how to use mock driver for unit testing?<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">It seems it generates fake events from json spec but what is the different between<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">- `xxx_snapshot_X.json` and `xxx_dynamic_X.json`<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">- `xxx_S` and `xxx_D`<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal">__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">
OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</body>
</html>