[asterisk-dev] [Code Review]: Make TestSuite Asterisk class create and install config files after instantiation

mjordan reviewboard at asterisk.org
Tue Nov 8 16:54:09 CST 2011



> On Nov. 8, 2011, 4:11 p.m., Matthew Nicholson wrote:
> > /asterisk/trunk/lib/python/asterisk/asterisk.py, line 232
> > <https://reviewboard.asterisk.org/r/1571/diff/1/?file=21653#file21653line232>
> >
> >     This check isn't necessary, it is done in __make_directory_structure()
> 
> mjordan wrote:
>     True.  Defensive coding, but it can be removed.
> 
> Matthew Nicholson wrote:
>     The other instances of the done/not done checks should probably be put into their functions too if possible to simplify things.

Agreed - I'll make those changes and drop it in.


- mjordan


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


On Nov. 8, 2011, 8:29 a.m., mjordan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1571/
> -----------------------------------------------------------
> 
> (Updated Nov. 8, 2011, 8:29 a.m.)
> 
> 
> Review request for Asterisk Developers, Jason Parker, Matthew Nicholson, and jrose.
> 
> 
> Summary
> -------
> 
> The Asterisk class, which wraps and manages an instance of Asterisk for the TestSuite, previously would make the configuration file directory structure and install the configuration files during construction.  This had several negative impacts, including:
> 1. Creating 'dummy' directories in the tmp directory that had no relation to the currently executing test
> 2. Making directories and installing configuration files when the location of Asterisk configuration files was all that was needed
> 
> This patch modifies the class to install the configuration files only when install_configs is called.  This was previously called from the constructor.  If install_configs is called for the non-default testsuite directory, the default configuration files are installed automatically once (this prevents the majority of tests from having to be modified).  If install_configs is not called prior to start_asterisk, then the default testsuite configuration files are installed.
> 
> During object creation, the location of the Asterisk directories, the base directory structure, and the 'numbered' instance of Asterisk for that test are all defined so that they can be used by an individual test.
> 
> 
> This addresses bug ASTERISK-18823.
>     https://issues.asterisk.org/jira/browse/ASTERISK-18823
> 
> 
> Diffs
> -----
> 
>   /asterisk/trunk/lib/python/asterisk/TestCase.py 2507 
>   /asterisk/trunk/lib/python/asterisk/asterisk.py 2556 
>   /asterisk/trunk/lib/python/asterisk/voicemail.py 2628 
> 
> Diff: https://reviewboard.asterisk.org/r/1571/diff
> 
> 
> Testing
> -------
> 
> Executed by the testsuite.  Ran using the --test option and without the --test option.  Tested both tests that inherit from TestCase, as well as those that do not.
> 
> 
> Thanks,
> 
> mjordan
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20111108/afc25ff9/attachment.htm>


More information about the asterisk-dev mailing list