Oleg Broytmann wrote:
> On Tue, Jan 23, 2007 at 11:51:27AM -0200, Johan Dahlin wrote:
>> Here is a patch I recently wrote that makes makes it easier to write code
>> that constructs queries dynamically:
>>
>> queries = []
>>
>> if some_condition:
>> queries.append(...)
>
> I am going to add the following test:
>
> def test_empty_AND():
> assert str(AND()) == "None"
> assert str(AND(True)) == "True"
> assert str(AND(1, 2)) == str(SQLOp("AND", 1, 2)) == "((1) AND (2))"
>
> str() is needed because AND() returns an SQLExpression that overrides
> comparison. The following
> AND('x', 'y') == "foo bar"
> is True! (-:
Eeek, but justified I guess :-)
>
> Can you think of a better test?
Not without adding lots of application specific data, I think that's fine.
You might want to add 3 and 4 arguments too, to test how the parenthesis are
going to be structured.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss