Appologies, please read the 2nd last line as:<div>Can you give me an indication of how you would go about doing this with TestFixtures? :)</div><div><br></div><div>Thanks</div><div><br></div><div>Jack</div><div><br></div><div>
<br><div class="gmail_quote">On Fri, Jan 14, 2011 at 2:39 PM, Jack Keegan <span dir="ltr"><<a href="mailto:whatsjacksemail@gmail.com">whatsjacksemail@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I'm new to python and have just been looking into a solution for Mocking objects. In particular, at the moment, testing some code that needs to access hardware IOs using DLLs. I do this using Ctypes.<div>However, on my dev machine, I don't have the same hardware so calling the DLL functions will not work as expected. Therefore I'd like to mock out the ctypes dll calls. Can you give me an indication of how you would go about doing this with Simplistix? Just so you know, I use py.test for unit testing.</div>

<div><br></div><div>Thanks,</div><div><br></div><div>Jack</div><div><div><div></div><div class="h5"><br><div class="gmail_quote">On Fri, Jan 14, 2011 at 12:38 PM, Chris Withers <span dir="ltr"><<a href="mailto:chris@simplistix.co.uk" target="_blank">chris@simplistix.co.uk</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<br>
<br>
I'm very happy to announce the first fully-documented release of TestFixtures, my collection of testing fixtures and helpers that I've been collecting for the last couple of years.<br>
<br>
Along with my own take on a lot of the common fixtures and helpers, it has some bits that I haven't seen anywhere else and so would like to point out:<br>
<br>
- Comparison objects for comparing objects that don't natively support<br>
  comparison:<br>
<br>
  <a href="http://packages.python.org/testfixtures/comparing.html#comparison-objects" target="_blank">http://packages.python.org/testfixtures/comparing.html#comparison-objects</a><br>
<br>
- Helpful mock objects for when you want to test code that makes use of<br>
  datetime.datetime.now, datetime.date.today or time.time:<br>
<br>
  <a href="http://packages.python.org/testfixtures/datetime.html" target="_blank">http://packages.python.org/testfixtures/datetime.html</a><br>
<br>
- Helpers for capturing and checking messages logged from your code<br>
  using the python logging framework:<br>
<br>
  <a href="http://packages.python.org/testfixtures/logging.html" target="_blank">http://packages.python.org/testfixtures/logging.html</a><br>
<br>
- Helpers for working with temporary directories in tests. In<br>
  particular, quickly and easily creating temporary directories and<br>
  files within them and making assertions about things written to them<br>
  by the code under test:<br>
<br>
  <a href="http://packages.python.org/testfixtures/files.html" target="_blank">http://packages.python.org/testfixtures/files.html</a><br>
<br>
There's plenty more in there too!<br>
<br>
Please do let me know what you find useful, if you find any bugs or if there are any features you'd like to see added.<br>
<br>
The package is on PyPI and a full list of all the links to docs, issue trackers and the like can be found here:<br>
<br>
<a href="http://www.simplistix.co.uk/software/python/testfixtures" target="_blank">http://www.simplistix.co.uk/software/python/testfixtures</a><br>
<br>
cheers,<br>
<br>
Chris<br>
<br>
-- <br>
Simplistix - Content Management, Batch Processing & Python Consulting<br>
           - <a href="http://www.simplistix.co.uk" target="_blank">http://www.simplistix.co.uk</a><br><font color="#888888">
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br><br clear="all"><br></div></div>-- <br>The earth is a very small stage in a vast cosmic arena. Think of the rivers of blood spilled by all those generals and emperors so that in glory and in triumph they could become the momentary masters of a fraction of a dot.<br>

- Carl Sagan [Pale Blue Dot]<br>
</div>
</blockquote></div><br><br clear="all"><br>-- <br>The earth is a very small stage in a vast cosmic arena. Think of the rivers of blood spilled by all those generals and emperors so that in glory and in triumph they could become the momentary masters of a fraction of a dot.<br>
- Carl Sagan [Pale Blue Dot]<br>
</div>