<div dir="ltr">Elisha, thanks for the explanation. The difference is clear to me now.<div><br></div><div>If I understand it correctly, the regular expression in spec JSON is for information only. It is never compiled into a `re` object.</div><div><br></div><div>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.</div><div><br></div><div>Is that right?</div></div><br><div class="gmail_quote"><div dir="ltr">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:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="#0563C1" vlink="#954F72" class="gmail_msg">
<div class="m_5306597561535435383WordSection1 gmail_msg">
<p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="gmail_msg">Hi,<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p>
<p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></span></p>
<p class="m_5306597561535435383MsoListParagraph gmail_msg"><u class="gmail_msg"></u><span style="font-size:11.0pt;font-family:Symbol" class="gmail_msg"><span class="gmail_msg">·<span style="font:7.0pt "Times New Roman"" class="gmail_msg">        
</span></span></span><u class="gmail_msg"></u><span dir="LTR" class="gmail_msg"></span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="gmail_msg">In Vitrage Datasources, we can have a different input format for snapshots and updates. Thus, we need a different JSON file for each.<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p>
<p class="m_5306597561535435383MsoListParagraph gmail_msg"><u class="gmail_msg"></u><span style="font-size:11.0pt;font-family:Symbol" class="gmail_msg"><span class="gmail_msg">·<span style="font:7.0pt "Times New Roman"" class="gmail_msg">        
</span></span></span><u class="gmail_msg"></u><span dir="LTR" class="gmail_msg"></span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="gmail_msg">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 class="gmail_msg">overwrites</u> the static one (marked with “S”).<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p>
<p class="m_5306597561535435383MsoListParagraph gmail_msg"><u class="gmail_msg"></u><span style="font-size:11.0pt;font-family:Symbol" class="gmail_msg"><span class="gmail_msg">·<span style="font:7.0pt "Times New Roman"" class="gmail_msg">        
</span></span></span><u class="gmail_msg"></u><span dir="LTR" class="gmail_msg"></span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="gmail_msg">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.<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p>
<p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></span></p>
<p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="gmail_msg">Elisha<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p>
<p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></span></p>
<p class="MsoNormal gmail_msg"><b class="gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="gmail_msg">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="gmail_msg"> Yujun Zhang [mailto:<a href="mailto:zhangyujun%2Bzte@gmail.com" class="gmail_msg" target="_blank">zhangyujun+zte@gmail.com</a>]
<br class="gmail_msg">
<b class="gmail_msg">Sent:</b> Monday, December 12, 2016 8:23 AM<br class="gmail_msg">
<b class="gmail_msg">To:</b> OpenStack Development Mailing List (not for usage questions) <<a href="mailto:openstack-dev@lists.openstack.org" class="gmail_msg" target="_blank">openstack-dev@lists.openstack.org</a>><br class="gmail_msg">
<b class="gmail_msg">Subject:</b> [openstack-dev] [vitrage] how to use mock driver<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p></div></div><div lang="EN-US" link="#0563C1" vlink="#954F72" class="gmail_msg"><div class="m_5306597561535435383WordSection1 gmail_msg">
<p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p>
<div class="gmail_msg">
<p class="MsoNormal gmail_msg">Is there any documentation on how to use mock driver for unit testing?<u class="gmail_msg"></u><u class="gmail_msg"></u></p>
<div class="gmail_msg">
<p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p>
</div>
<div class="gmail_msg">
<p class="MsoNormal gmail_msg">It seems it generates fake events from json spec but what is the different between<u class="gmail_msg"></u><u class="gmail_msg"></u></p>
</div>
<div class="gmail_msg">
<p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p>
</div>
<div class="gmail_msg">
<p class="MsoNormal gmail_msg">- `xxx_snapshot_X.json` and `xxx_dynamic_X.json`<u class="gmail_msg"></u><u class="gmail_msg"></u></p>
</div>
<div class="gmail_msg">
<p class="MsoNormal gmail_msg">- `xxx_S` and `xxx_D`<u class="gmail_msg"></u><u class="gmail_msg"></u></p>
</div>
<div class="gmail_msg">
<p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p>
</div>
</div>
</div></div><div lang="EN-US" link="#0563C1" vlink="#954F72" class="gmail_msg"><div class="m_5306597561535435383WordSection1 gmail_msg"></div>
</div>

__________________________________________________________________________<br class="gmail_msg">
OpenStack Development Mailing List (not for usage questions)<br class="gmail_msg">
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" class="gmail_msg" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br class="gmail_msg">
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br class="gmail_msg">
</blockquote></div>