Hello everyone,
I'm trying to choose a mocking package for my testings and was overwhelmed
by the number of different packages
http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy#MockTestingTools
Could anyone give me some tips where to start?
I've done a lot of unit testing but this is my first attempt at mocking so I
am looking for a tool that would be simple and easy to understand for
mocking novices like me.
Here is an example of what I'm trying to achieve:
I have a function that updates data in a database table.
def UpdateData(key,data):
if key exists in the table:
if data is identical to the data in the table:
do nothing
else:
update the data in the table
else:
insert a new row
When unit testing I can make a "select" to verify that the data is correctly
updated, but I also want to verify that the function updates the table or
does nothing when needed.
So basically I need a way to verify:
1. that no SQL command was issued if the data was identical
2. an execute('UPDATE ...') function call was issued if the data needed to
be updated
3. an execute('INSERT ..") function call was issued if the key did nit exist
in the table
Best regards,
Shaya
_______________________________________________
Python-il mailing list
[email protected]
http://hamakor.org.il/cgi-bin/mailman/listinfo/python-il