Re: organizing python code with tests

2008-08-15 Thread Alex Marandon
eliben wrote: Hello, At the moment, I place all the code of my project in a src/ directory, and all the tests in a sibling tests/ directory, so for instance a sample project can look like this: doc/ ... src/ play.py write.py tests/ test_play.py test_write.py While this works fine, I

Re: Testing for Internet Connection

2008-07-15 Thread Alex Marandon
Alexnb wrote: I am wondering, is there a simple way to test for Internet connection? If not, what is the hard way :p Trying to fetch the homepage from a few major websites (Yahoo, Google, etc.)? If all of them are failing, it's very likely that the connection is down. You can use urllib2 [1]