[asterisk-dev] [Code Review] 4134: testsute: Add 'add-relative-to-search-path' handler to TestModuleLoader

Mark Michelson reviewboard at asterisk.org
Fri Oct 31 11:24:52 CDT 2014


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

Ship it!



asterisk/trunk/lib/python/asterisk/test_runner.py
<https://reviewboard.asterisk.org/r/4134/#comment24161>

    Use os.path.join(test_path, path) instead of the string manipulations.


- Mark Michelson


On Oct. 30, 2014, 10:14 p.m., George Joseph wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4134/
> -----------------------------------------------------------
> 
> (Updated Oct. 30, 2014, 10:14 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: testsuite
> 
> 
> Description
> -------
> 
> I've got some common code I want to share between a few tests so it's in the test's parent directory.  However, there doesn't seem to be a way to add the parent directory to the search path without specifying an absolute path.  So, I added a helper to TestModuleLoader that will allow you to add paths relative to the test directory.
> 
> Example:
> 
> test-modules:
>     add-test-to-search-path: 'True'
>     add-relative-to-search-path: ['..']
>     test-object:
>         config-section: object-config
>         typename: 'ManagerConfigTest.ManagerConfigTest'
> 
> This adds <test_path>/.. to the search path. I.E. The test's parent directory.
> 
> 
> Diffs
> -----
> 
>   asterisk/trunk/lib/python/asterisk/test_runner.py 5817 
> 
> Diff: https://reviewboard.asterisk.org/r/4134/diff/
> 
> 
> Testing
> -------
> 
> Works for my tests and doesn't affect any others.
> 
> 
> Thanks,
> 
> George Joseph
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20141031/84e74405/attachment-0001.html>


More information about the asterisk-dev mailing list