Ok, here it is. It is a demo product, which has one class, GenerateInsert, which will generate an insert based on your parameters. I've also written a small test, which tries to show what I would do: test that given the proper parameters, it will generate the proper string. The case I'm showing is very simple, but it could be extended to other cases as well...

Also, if you want to take a look at some tests in database environment, you could take a look at paflow (www.paflow.it) where there is quite a lot of tests...


On 4/12/06, Paul Winkler <[EMAIL PROTECTED]> wrote:
On Wed, Apr 12, 2006 at 06:51:18PM +0200, Marco Bizzarri wrote:
> The problem is what you want to test. I'm not familiar with Zope 3,
> therefore I'm talk on the base of ZSQLMethod.SQL.SQL from Zope 2.
> If I understand correctly, you've some high level construct which creates an
> nvSQL instance.


> Now, if you put yourself at the end of the line, what you
> need to do is to parse the output of nvSQL, in order to see if the generated
> SQL is correct.
> What you're doing therefore is to test whether nvSQL is able to generate
> correctly the SQL. But I think this is not what you want to test. You could
> safely assume that, given the proper input, nvSQL will generate the proper
> output.
> Therefore, what you should test is that the generated nvSQL has the
> appropriate characteristics.


I am also open to suggestions on what kind of characteristics
I should be interested in.  I have never written tests of generated
SQL before.

> I will try to post a sample for Zope2, just to give an idea of what could be
> done.

That would be very helpful, thank you.


Paul Winkler
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-dev )

Icube Srl

Attachment: SimpleSQLTests.tar.gz
Description: GNU Zip compressed data

Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to