On Tue, Apr 8, 2008 at 11:16 PM, Aaron Bentley &lt;<a href="mailto:aaron@aaronbentley.com">aaron@aaronbentley.com</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
bb:resubmit<br>
<br>
I&#39;d like to see this platform detection factored out into an osutils<br>
method. &nbsp;We shouldn&#39;t be repeating ourselves here. &nbsp;Maybe<br>
osutils.apps_support_symlinks<br>
</blockquote><div><br>Will do.&nbsp; How about osutils.host_os_can_dereference_symlinks?&nbsp; ...though the new method may not apply to the caller below since the test is Windows-specific.&nbsp; See my answer regarding &#39;attrib&#39; below.<br>
&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; + &nbsp; &nbsp;def test_execute_windows_tool(self):<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp;if (sys.platform != &#39;windows&#39;<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;and sys.platform != &#39;cygwin&#39;):<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;raise tests.TestSkipped(&#39;Platform does not have Windows tools.&#39;)<br>
<br>
TestSkipped is rather generic. &nbsp;We usually use UnavailableFeature (via<br>
our requireFeature code) to indicate platform differences. &nbsp;Though the<br>
&quot;feature&quot; in this case is a deficiency, bringing new meaning to the<br>
phrase &quot;it&#39;s not a bug, it&#39;s a feature&quot;.<br>
</blockquote><div><br>Is there an agreement between you and Alexander?<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; + &nbsp; &nbsp; &nbsp; &nbsp;output = StringIO()<br>

&gt; + &nbsp; &nbsp; &nbsp; &nbsp;tree = self.make_branch_and_tree(&#39;tree&#39;)<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp;self.build_tree_contents([(&#39;tree/file&#39;, &#39;content&#39;)])<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp;tree.add(&#39;file&#39;, &#39;file-id&#39;)<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp;tree.commit(&#39;old tree&#39;, timestamp=0)<br>
<br>
^^^ The timestamp value doesn&#39;t seem to be required here.<br>
</blockquote><div><br>OK, I can remove that.<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; + &nbsp; &nbsp; &nbsp; &nbsp;tree.lock_read()<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp;self.addCleanup(tree.unlock)<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp;diff_obj = DiffFromTool([&#39;python&#39;, &#39;-c&#39;,<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#39;print &quot;%(old_path)s %(new_path)s&quot;&#39;],<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tree, tree, output)<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp;diff_obj._prepare_files(&#39;file-id&#39;, &#39;file&#39;, &#39;file&#39;)<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp;proc = subprocess.Popen([&#39;attrib&#39;, &#39;old/file&#39;],<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;stdout=subprocess.PIPE,<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cwd=diff_obj._root)<br>
<br>
^^^ err, what are you doing with attrib here? &nbsp;We do not normally use<br>
subprocesses in our test suite.<br></blockquote><div><br>Verifying that a tool (attrib) in the host OS (Windows) that understands mixed paths (with &#39;/&#39; rather than &#39;\&#39;) can read the files on both sides of the diff.<br>
<br>I&#39;m using a subprocess because the feature I&#39;m testing is support for diff subprocesses in the host OS.<br><br>Matt<br></div></div>