Let me embarrass myself. My question pertains to software testing, as
it applies to pylons, and in general.

My current objective is building a rest API. The most simple example
is a user object behind the rest API. I basically need to create,
update, read, and delete a user. I've built the rest controllers, and
I'm trying to write the tests. I'm attempting to use nosetests.

The tests are meant to be able to be run in any random order. There
doesn't appear to be any way (other than naming them test_a, test_b,
etc) to control the order they're run in (and this is by design, and
for good reason). However, on the surface, it seems to me like I'd
like to go through the tests in order, first creating a user, then
reading, then updating, then deleting it, all tests working on the
same user "object". The user id I got back from the create call is the
user id I'd use to update the user, read user information, and finally
delete the user.  Instead, it seems like I'm meant to do some setup
and teardown, and do each test isolated from each other test, with a
new call to the controller each time, with no connection between them.
So, for example, I'd have to create a new user to delete it, which is
awkward, since there is already a whole test just for creation.

So, after the exposition, am I completely wrong headed, or am I
reading the wrong websites/blogs, or am I beyond saving? Is there a
way to string tests together so that one relies on the previous one,
and if any fail, the whole thing fails? (Even extending that between
modules, so that a user might have some property, and the user id can
extend to another set of tests?) I've tried to do my due diligence,
and read about unit testing, functional testing, and system testing.
If anyone would be kind enough to answer, or point me in the right
direction, or offer any help, I'd be indebted to them for life.

Thanks so much in advance, and if you wanna ignore or flame, I'll
still buy you a beer if I meet you in a bar in Pittsburgh. And a shot
or something.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to