[asterisk-dev] [Code Review] python TestCase class

Paul Belanger reviewboard at asterisk.org
Thu Dec 9 18:55:13 UTC 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1054/#review3016
-----------------------------------------------------------



asterisk/trunk/lib/python/asterisk/TestCase.py
<https://reviewboard.asterisk.org/r/1054/#comment6231>

    TODO: pass ast_options to Asterisk instance.



asterisk/trunk/lib/python/asterisk/TestCase.py
<https://reviewboard.asterisk.org/r/1054/#comment6232>

    Ugly.  I do have a possible solution which will create a new 'host' parameter for the Asterisk class.  Since we have access to 127.0.0.0/8, loopback.  We could pass each Asterisk instance we create the next available IP in the range.  
    
    The trick would then be to add logic to update ALL asterisk configuration file to use that IP address.   I have some ideas about using #include statements however some have expressed it may not be the best solution.
    
    Another solution would be to dynamically create each .config file or open then, find the bindaddr and replace it.



asterisk/trunk/lib/python/asterisk/TestCase.py
<https://reviewboard.asterisk.org/r/1054/#comment6233>

    I don't believe callback support arguments, so I incremented each function by 1 for each ami_factory created.
    
    
    ami_connect1(), ami_connect2(), etc



asterisk/trunk/lib/python/asterisk/asterisk.py
<https://reviewboard.asterisk.org/r/1054/#comment6234>

    Tests should not be able to override the default base of the testsuite.  Because of filename length issue, all tests default to /tmp/asterisk-tests
    
    If we do override base, we now append the path to /tmp/asterisk-tests.



asterisk/trunk/runtests.py
<https://reviewboard.asterisk.org/r/1054/#comment6229>

    TODO: ast = Asterisk("runtests")
    
    Additionally, I'm not a fan of this solution to detect fax dependencies.



asterisk/trunk/runtests.py
<https://reviewboard.asterisk.org/r/1054/#comment6230>

    Suggestion for cleaning this up?  I need to know the name of the test to create the directory structure for the Asterisk class.  I could only think of passing it as an argument.



asterisk/trunk/tests/manager/login/run-test
<https://reviewboard.asterisk.org/r/1054/#comment6235>

    Not sure if this logic is correct to run a parent function.  Need to look into the super() function.


- Paul


On 2010-12-09 12:44:06, Paul Belanger wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1054/
> -----------------------------------------------------------
> 
> (Updated 2010-12-09 12:44:06)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Warning: This is a work in progress
> 
> I wanted to get some initial feedback about creating an Asterisk TestCase class, tests in the testsuite can inherit.  For this first review I have converted 2 tests to use the new TestCase class.
> 
> See my inline comments further info, and feedback is required :) 
> 
> 
> Diffs
> -----
> 
>   asterisk/trunk/lib/python/asterisk/TestCase.py PRE-CREATION 
>   asterisk/trunk/lib/python/asterisk/__init__.py 1120 
>   asterisk/trunk/lib/python/asterisk/asterisk.py 1120 
>   asterisk/trunk/runtests.py 1120 
>   asterisk/trunk/tests/manager/login/run-test 1120 
>   asterisk/trunk/tests/udptl/configs/ast2/manager.conf 1120 
>   asterisk/trunk/tests/udptl/run-test 1120 
> 
> Diff: https://reviewboard.asterisk.org/r/1054/diff
> 
> 
> Testing
> -------
> 
> Local development box
> 
> 
> Thanks,
> 
> Paul
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20101209/2a28bb33/attachment-0001.htm 


More information about the asterisk-dev mailing list