[TIP] Writing Separate Functional Tests

Noah Gift noah.gift at gmail.com
Wed Nov 21 13:03:42 PST 2007


On Nov 21, 2007, at 10:51 AM, Laura Creighton wrote:

> In a message of Wed, 21 Nov 2007 10:18:17 EST, "Noah Gift" writes:
>> --===============1433746764==
>> Content-Type: multipart/alternative;
>> 	boundary="----=_Part_2709_6144239.1195658297185"
>>
>> ------=_Part_2709_6144239.1195658297185
>> Content-Type: text/plain; charset=ISO-8859-1
>> Content-Transfer-Encoding: 7bit
>> Content-Disposition: inline
>>
>> On Nov 21, 2007 10:14 AM, David Malcolm <dmalcolm at redhat.com> wrote:
>>
>>> On Wed, 2007-11-21 at 09:35 -0500, Noah Gift wrote:
>>>> I have a gigantic threaded beast I need to test, and I want to  
>>>> write
>>>> functional tests that supplement the doctests and unittests, but
>>>> wanted some advice on the proper way to do this.  I have not seen  
>>>> muc
>> h
>>>> documentation on writing non-web functional tests, my tool is a CLI
>>>> tool. The basic thing I want to verify is that my tool creates a  
>>>> XML
>>>> file with the information I would expect to be there.  For  
>>>> example, i
>> s
>>>> there a selenium equivalent for command line tools?
>>>>
>>> Have you tried the "expect" tool; see e.g.
>>> http://pexpect.sourceforge.net/
>>>
>>> Doesn't do recording AFAIK, but useful for invoking CLI tools in a
>>> testing context
>>>
>>
>> Dave,
>>
>> I hadn't even thought of that, using pexpect is an interesting idea  
>> thoug
>> h.
>> Recording command line tools seems like it could be a really cool  
>> open
>> source testing project actually, now that I think about it  
>> more....  Mayb
>> e a
>> Sprint for PyCon?
>>
>>
>>>
>>>
>>> Hope this helps
>>> Dave Malcolm
>>>
>
> Expect has a granularity in seconds.  If you need to measure that
> something happens sooner than that, then expect is not for you.
>
> Been there, done that, got supremely frustrated.
>
> If you happen to need to be testing CISCO routers, I may have a
> pile of old C code that can help.

I am mostly doing Python bindings to Net-SNMP related stuff with CISCO  
routers, but if you have anything SNMP/CISCO related I would be  
interested.

>
>
> Laura




More information about the testing-in-python mailing list