where should dummy classes reside.

0 views
Skip to first unread message

Samuel Ytterbrink

unread,
Nov 8, 2011, 9:23:05 AM11/8/11
to pytd...@googlegroups.com
Hi! im doing some work on writing a better test coverage fro the new classes and so on.

When doing a lot of these tests i need dummy classes the works as if they where another component. However i very often need the same classes over and over again.
Wat i do now is the copy paste, we are in a hurry after all. but....

We will need to refactor this, but where should we put them?
i have 2 ideas:
* putt them in pytddmon.py where they actually could be useful for debugging, and you can see them right away when you change the original. 
* create a package on the root level called dummy or something like that.

--
//Samuel Ytterbrink

Olof Bjarnason

unread,
Nov 8, 2011, 9:26:39 AM11/8/11
to pytd...@googlegroups.com
Without a doubt a dummies-folder then. But I'd prefer it in the tests/
subfolder, not at root level. I guess it will be importable as
tests.dummies then?

(Another idea is to introduce Carlos pyDoubles for mocking objects
easily, but that would mean developing pytddmon gets more
complicated/costly.)


2011/11/8 Samuel Ytterbrink <nep...@gmail.com>:

Samuel Ytterbrink

unread,
Nov 8, 2011, 9:30:59 AM11/8/11
to pytd...@googlegroups.com
What is Carlos pyDubles?

2011/11/8 Olof Bjarnason <olof.bj...@gmail.com>



--
//Samuel Ytterbrink

Olof Bjarnason

unread,
Nov 8, 2011, 9:32:10 AM11/8/11
to pytd...@googlegroups.com
A cool project to create mocks, stubs and so on very easily:

http://www.pydoubles.org/

It's using pytddmon (or used to at least)

2011/11/8 Samuel Ytterbrink <nep...@gmail.com>:

Samuel Ytterbrink

unread,
Nov 8, 2011, 9:44:38 AM11/8/11
to pytd...@googlegroups.com
okay, well its not that much of a problem yet to make them, only to have the same imple all over. so not now.

Though it was a interesting project.

2011/11/8 Olof Bjarnason <olof.bj...@gmail.com>



--
//Samuel Ytterbrink

Olof Bjarnason

unread,
Nov 8, 2011, 10:00:52 AM11/8/11
to pytd...@googlegroups.com
2011/11/8 Samuel Ytterbrink <nep...@gmail.com>:

> okay, well its not that much of a problem yet to make them, only to have the
> same imple all over. so not now.

OK. If you do go down that road, I'd suggest calling it "fakes"
instead of "dummies", since that's what the classes are called. :)

Rafael Capucho

unread,
Nov 8, 2011, 10:35:41 AM11/8/11
to pytd...@googlegroups.com
Hello Everybody,

I use Python Mocker[1] by another brasilian Gustavo Niemeyer (Canonical-Ubuntu).

It's very easy to use and powerful.

Best Regards!

* This works properly in python 2.7 too, in the project home page says until 2.6.

[1] - http://labix.org/mocker




--
Rafael Capucho
Acrescentar Consultoria & Planejamento
www.acrescentar.com

PGP-Public Key: 2048R/7389A96F pgp.mit.edu
FP: EDB5 CDEE 8442 99CC C92D 9173 6B32 A5C9 7389 A96F

Samuel Ytterbrink

unread,
Nov 8, 2011, 2:08:35 PM11/8/11
to pytd...@googlegroups.com
HI!

if we are to use any of them my vote is får pydoubels, it looks more like how I code. It also gives the most features that is associated with less coding, at least from what I have seen in there documentation.

2011/11/8 Rafael Capucho <rafael....@gmail.com>



--
//Samuel Ytterbrink
Reply all
Reply to author
Forward
0 new messages