<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>My stuff</title>
	<atom:link href="http://michelhollands.net/blog/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://michelhollands.net/blog</link>
	<description>Tech and travel tidbits</description>
	<lastBuildDate>Tue, 15 May 2012 20:18:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Stubbing out open() in Python</title>
		<link>http://michelhollands.net/blog/2012/05/15/stubbing-out-open-in-python/</link>
		<comments>http://michelhollands.net/blog/2012/05/15/stubbing-out-open-in-python/#comments</comments>
		<pubDate>Tue, 15 May 2012 20:16:52 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/?p=285</guid>
		<description><![CDATA[Here&#8217;s an example that stubs out the open() function in Python using the mock library. from StringIO import StringIO from mock import patch # We are testing these 2 functions : def read_sys(): f = open('/sys/something') data = f.readline().strip() f.close() return data def read_dev(): f = open('/dev/something') data = f.readline().strip() f.close() return data # Test [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an example that stubs out the open() function in Python using the <a href="http://www.voidspace.org.uk/python/mock/">mock library</a>.</p>
<pre lang='python'>
from StringIO import StringIO

from mock import patch

# We are testing these 2 functions :

def read_sys():
    f = open('/sys/something')
    data = f.readline().strip()
    f.close()
    return data

def read_dev():
    f = open('/dev/something')
    data = f.readline().strip()
    f.close()
    return data

# Test helper function

def side_effect_function(path):
    if path.startswith('/sys/something'):
        return StringIO('abcd')
    if path.startswith('/dev/something'):
        return StringIO('zyxw')

# Actual test, this would be in a testcase for a real unit test

with patch('__builtin__.open') as mocked_open:
     mocked_open.side_effect = side_effect_function

     data = read_sys()
     assert data == 'abcd'
     data = read_dev()
     assert data == 'zyxw'
</pre>
<p>With this kind of mock object you don&#8217;t have to create temporary files just for the test.</p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2012/05/15/stubbing-out-open-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uruguay</title>
		<link>http://michelhollands.net/blog/2012/04/21/uruguay/</link>
		<comments>http://michelhollands.net/blog/2012/04/21/uruguay/#comments</comments>
		<pubDate>Sat, 21 Apr 2012 16:08:24 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/?p=275</guid>
		<description><![CDATA[Here are some photos from a trip to Urugyay :]]></description>
			<content:encoded><![CDATA[<p>Here are some photos from a trip to Urugyay :</p>
<p><center><br />
<a href="http://www.michelhollands.net/g2/main.php?g2_view=core.ShowItem&#038;g2_itemId=2672"><br />
<img src="http://michelhollands.net/blog/wp-content/uploads/2012/04/DSC04703.jpg" alt="Uruguay" /><br />
</a><br />
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2012/04/21/uruguay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Correlation or causation</title>
		<link>http://michelhollands.net/blog/2011/12/13/correlation-or-causation/</link>
		<comments>http://michelhollands.net/blog/2011/12/13/correlation-or-causation/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 09:59:22 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/?p=267</guid>
		<description><![CDATA[Statistics are easy : http://www.businessweek.com/magazine/correlation-or-causation-12012011-gfx.html]]></description>
			<content:encoded><![CDATA[<p>Statistics are easy :</p>
<p><a href="http://www.businessweek.com/magazine/correlation-or-causation-12012011-gfx.html">http://www.businessweek.com/magazine/correlation-or-causation-12012011-gfx.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2011/12/13/correlation-or-causation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yorkshire Sculpture Park</title>
		<link>http://michelhollands.net/blog/2011/10/09/260/</link>
		<comments>http://michelhollands.net/blog/2011/10/09/260/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 15:43:05 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/?p=260</guid>
		<description><![CDATA[Here are some photos from the Yorkshire Sculpture Park :]]></description>
			<content:encoded><![CDATA[<p>Here are some photos from the <a href="http://www.ysp.co.uk/home">Yorkshire Sculpture Park</a> :</p>
<p><center><br />
<a href="http://www.michelhollands.net/g2/main.php?g2_view=core.ShowItem&#038;g2_itemId=2588"><br />
<img src="http://michelhollands.net/blog/wp-content/uploads/2011/10/DSC04326_small.jpg" alt="YSP" /></a><br />
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2011/10/09/260/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cool Python</title>
		<link>http://michelhollands.net/blog/2011/10/09/cool-python/</link>
		<comments>http://michelhollands.net/blog/2011/10/09/cool-python/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 15:33:36 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/?p=256</guid>
		<description><![CDATA[Check out the example in the 3rd comment : http://code.activestate.com/recipes/413137-call-a-functionmethod-x-times-per-second/ That is cool.]]></description>
			<content:encoded><![CDATA[<p>Check out the example in the 3rd comment :</p>
<p><a href="http://code.activestate.com/recipes/413137-call-a-functionmethod-x-times-per-second/">http://code.activestate.com/recipes/413137-call-a-functionmethod-x-times-per-second/</a></p>
<p>That is cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2011/10/09/cool-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Egypt</title>
		<link>http://michelhollands.net/blog/2011/05/07/egypt/</link>
		<comments>http://michelhollands.net/blog/2011/05/07/egypt/#comments</comments>
		<pubDate>Sat, 07 May 2011 20:20:14 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/?p=238</guid>
		<description><![CDATA[I went on a great trip to Egypt. First there was a cruise on the Nile and then a visit to Cairo. Click on Abu Simbel to see the pictures.]]></description>
			<content:encoded><![CDATA[<p>I went on a great trip to Egypt. First there was a cruise on the Nile and then a visit to Cairo. Click on Abu Simbel to see the pictures.</p>
<p><a href="http://www.michelhollands.net/g2/main.php?g2_view=core.ShowItem&#038;g2_itemId=2468"><img src="http://michelhollands.net/blog/wp-content/uploads/2011/05/AbuSimbel-small.jpg" alt="" title="AbuSimbel-small" width="320" height="240" class="aligncenter size-full wp-image-239" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2011/05/07/egypt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Revolution</title>
		<link>http://michelhollands.net/blog/2011/03/03/revolution/</link>
		<comments>http://michelhollands.net/blog/2011/03/03/revolution/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 11:35:33 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/?p=233</guid>
		<description><![CDATA[The picture below should be on posters and T-shirts. I would definitely buy them.]]></description>
			<content:encoded><![CDATA[<p><a href="http://imgur.com/gallery/noiYR">The picture below</a> should be on posters and T-shirts. I would definitely buy them.</p>
<p><img src="http://i.imgur.com/noiYR.jpg" alt="Recolucion" /></p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2011/03/03/revolution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Banksy&#8217;s take on Star Wars</title>
		<link>http://michelhollands.net/blog/2011/02/16/banksys-take-on-star-wars/</link>
		<comments>http://michelhollands.net/blog/2011/02/16/banksys-take-on-star-wars/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 11:08:03 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/?p=229</guid>
		<description><![CDATA[Apparently Banksy put this Star Wars parody up in Melbourne in Australia. Funny.]]></description>
			<content:encoded><![CDATA[<p>Apparently Banksy put <a href="http://www.flickr.com/photos/tashland/295777390/sizes/l/in/photostream/">this Star Wars parody</a> up in Melbourne in Australia. Funny.</p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2011/02/16/banksys-take-on-star-wars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Holiday time</title>
		<link>http://michelhollands.net/blog/2010/11/13/holiday-time/</link>
		<comments>http://michelhollands.net/blog/2010/11/13/holiday-time/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 19:59:34 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/?p=216</guid>
		<description><![CDATA[My big holiday this year was to the US. Firstly I took a boat from Southampton to New York. Then a train from NY to Boston. And lastly a plane took me to Toronto. The weather was great, except on the boat. Boston and Toronto are very nice cities well worth a visit. Here are [...]]]></description>
			<content:encoded><![CDATA[<p>My big holiday this year was to the US. Firstly I took a boat from Southampton to New York. Then a train from NY to Boston. And lastly a plane took me to Toronto. The weather was great, except on the boat. Boston and Toronto are very nice cities well worth a visit.</p>
<p>Here are the pictures :</p>
<p><center><br />
<a href="http://www.michelhollands.net/g2/main.php?g2_view=core.ShowItem&amp;g2_itemId=2309"><img src="http://michelhollands.net/blog/wp-content/uploads/2010/11/IMG_0074.jpg" alt="" title="Queen Mary 2" width="179" height="240" class="size-full wp-image-218" /></a><a href="http://www.michelhollands.net/g2/main.php?g2_view=core.ShowItem&amp;g2_itemId=2348"><img src="http://michelhollands.net/blog/wp-content/uploads/2010/11/DSC03368.jpg" alt="" title="Boston" width="180" height="240" class="aligncenter size-full wp-image-220" /></a><a href="http://www.michelhollands.net/g2/main.php?g2_view=core.ShowItem&amp;g2_itemId=2390"><img src="http://michelhollands.net/blog/wp-content/uploads/2010/11/DSC03512.jpg" alt="" title="Toronto" width="180" height="240" class="aligncenter size-full wp-image-221" /></a><br />
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2010/11/13/holiday-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leeds Castle</title>
		<link>http://michelhollands.net/blog/2010/09/19/leeds-castle/</link>
		<comments>http://michelhollands.net/blog/2010/09/19/leeds-castle/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 18:35:30 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://michelhollands.net/blog/?p=205</guid>
		<description><![CDATA[Here are some photos from a visit to Leeds Castle, Canterbury Cathedral and Audley End : Click on the picture to see them.]]></description>
			<content:encoded><![CDATA[<p>Here are some photos from a visit to Leeds Castle, Canterbury Cathedral and Audley End :</p>
<p><a href="http://www.michelhollands.net/g2/main.php?g2_view=core.ShowItem&#038;g2_itemId=2276&#038;g2_navId=xf3bf6ee7"><div id="attachment_206" class="wp-caption aligncenter" style="width: 190px"><img src="http://michelhollands.net/blog/wp-content/uploads/2010/09/DSC03042_small.jpg" alt="Canterbury Cathedral gate" title="Canterbury Cathedral gate" width="180" height="240" class="size-full wp-image-206" /><p class="wp-caption-text">Canterbury Cathedral gate</p></div></a></p>
<p>Click on the picture to see them.</p>
]]></content:encoded>
			<wfw:commentRss>http://michelhollands.net/blog/2010/09/19/leeds-castle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.341 seconds -->
<!-- Cached page served by WP-Cache -->

