Re: Mocking `from foo import *` functions

2009-01-12 Thread Silfheed
Brilliant, I love it. Thanks a million, guys. -- http://mail.python.org/mailman/listinfo/python-list

Mocking `from foo import *` functions

2009-01-09 Thread Silfheed
So I'm in the current testing situation: sender.py: - def sendEmails(): return "I send emails" alerter.py: - from sender import * def DoStuffAndSendEmails(): doStuff() sendEmails() I'm trying to write a test fn that will test DoStuffAndSendEmails() (as well as it's

Re: PIL's ImageFile Parser and PNG's

2008-11-13 Thread Silfheed
On Nov 12, 6:04 pm, Silfheed <[EMAIL PROTECTED]> wrote: > On Nov 12, 5:28 pm,Silfheed<[EMAIL PROTECTED]> wrote: > > > > > Heyas > > > So I've been messing around with the PIL and PNG's and came across a > > little problem with PNG's. &g

Re: PIL's ImageFile Parser and PNG's

2008-11-12 Thread Silfheed
On Nov 12, 5:28 pm, Silfheed <[EMAIL PROTECTED]> wrote: > Heyas > > So I've been messing around with the PIL and PNG's and came across a > little problem with PNG's. > > So just to clarify, I'm running with the standard ubuntu 8.04 python- > imagi

PIL's ImageFile Parser and PNG's

2008-11-12 Thread Silfheed
Heyas So I've been messing around with the PIL and PNG's and came across a little problem with PNG's. So just to clarify, I'm running with the standard ubuntu 8.04 python- imaging package that installs zlib and all the other goodies that go along to make the PIL work with PNG's nicely. So this w

Re: CDATA and lxml

2008-04-11 Thread Silfheed
On Apr 11, 3:49 pm, Silfheed <[EMAIL PROTECTED]> wrote: > On Apr 11, 10:33 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > > > > > Hi again, > > > Stefan Behnel wrote: > > > Silfheed wrote: > > >> So first off I know that CDATA is gener

Re: CDATA and lxml

2008-04-11 Thread Silfheed
On Apr 11, 10:33 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Hi again, > > Stefan Behnel wrote: > > Silfheed wrote: > >> So first off I know that CDATA is generally hated and just shouldn't > >> be done, but I'm simply required to parse it and s

CDATA and lxml

2008-04-11 Thread Silfheed
Heyas So first off I know that CDATA is generally hated and just shouldn't be done, but I'm simply required to parse it and spit it back out. Parsing is pretty easy with lxml, but it's the spitting back out that's giving me issues. The fact that lxml strips all the CDATA stuff off isnt really a b

Re: PYTHONPATH, opensuse10.2, gtk not working

2007-10-05 Thread Silfheed
On Oct 5, 1:04 pm, Silfheed <[EMAIL PROTECTED]> wrote: > On Oct 4, 8:31 pm, Silfheed <[EMAIL PROTECTED]> wrote: > > > > > On Oct 4, 7:39 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > > > Silfheed wrote: > > > > Heyas > > > >

Re: PYTHONPATH, opensuse10.2, gtk not working

2007-10-05 Thread Silfheed
On Oct 4, 8:31 pm, Silfheed <[EMAIL PROTECTED]> wrote: > On Oct 4, 7:39 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > > > > Silfheed wrote: > > > Heyas > > > > So I'm trying to do two things, install a little gnome taskbar applet > &

Re: PYTHONPATH, opensuse10.2, gtk not working

2007-10-04 Thread Silfheed
On Oct 4, 7:39 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Silfheed wrote: > > Heyas > > > So I'm trying to do two things, install a little gnome taskbar applet > > (timer-applet) that was written in python and experiment with writing > > python gtk apps.

PYTHONPATH, opensuse10.2, gtk not working

2007-10-04 Thread Silfheed
Heyas So I'm trying to do two things, install a little gnome taskbar applet (timer-applet) that was written in python and experiment with writing python gtk apps. I've installed (through yast) gtk, gtk2, gtk2-devel, python-gtk, python-gtk-devl, python-gtk-doc but I still cant get python to import

Re: Adjusting the names of custom exceptions (since raising strings is deprecated)

2007-08-21 Thread Silfheed
On Aug 21, 1:53 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Silfheed wrote: > > On Aug 21, 1:32 am, James Stroud <[EMAIL PROTECTED]> wrote: > >> Silfheed wrote: > >> > Heyas > > >> > So this probably highlights my lack of understanding of h

Re: Adjusting the names of custom exceptions (since raising strings is deprecated)

2007-08-21 Thread Silfheed
On Aug 21, 1:32 am, James Stroud <[EMAIL PROTECTED]> wrote: > Silfheed wrote: > > Heyas > > > So this probably highlights my lack of understanding of how naming > > works in python, but I'm currently using FailUnlessRaises in a unit > > test and raising

Adjusting the names of custom exceptions (since raising strings is deprecated)

2007-08-20 Thread Silfheed
Heyas So this probably highlights my lack of understanding of how naming works in python, but I'm currently using FailUnlessRaises in a unit test and raising exceptions with a string exception. It's working pretty well, except that I get the deprecation warning that raising a string exception is

Re: the one python book

2007-08-05 Thread Silfheed
On Aug 4, 6:23 am, "dhr" <[EMAIL PROTECTED]> wrote: Assuming that you already know that a ton of great stuff is on the web, I'd also recommend 'Programming Python' and 'Python Cookbook'. 'The Python Book' would have to be the Python book ('Programming Python', cuz it has a python on the cover and

Re: how to get next month string?

2007-07-25 Thread Silfheed
Sounds like a job for dateutil (http://labix.org/python-dateutil). It's not a built in module (it's in the cheeseshop at least), but it looks like it pretty much does exactly what you want. If you really dont want to download anything, I suppose you could create something from datetime's timedelta

Re: Python automatic testing: mocking an imported module?

2007-03-29 Thread Silfheed
Wow, that works great! Thanks all! On Mar 28, 12:02 am, Ben Finney <[EMAIL PROTECTED]> wrote: > "Silfheed" <[EMAIL PROTECTED]> writes: > = foo.py = > class Bar(object): > def __init__(self): > self.name = "bar" > = >

Python automatic testing: mocking an imported module?

2007-03-27 Thread Silfheed
Heyas So we have the following situation: we have a testee.py that we want to automatically test out and verifiy that it is worthy of being deployed. We want our tester.py to test the code for testee.py without changing the code for testee.py. testee.py has a module in it that we want to mock in