[asterisk-commits] russell: testsuite/asterisk/trunk r155 - /asterisk/trunk/lib/python/asterisk/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Mar 26 16:41:32 CDT 2010
Author: russell
Date: Fri Mar 26 16:41:29 2010
New Revision: 155
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=155
Log:
Allow forward slash in option values, add test case
Modified:
asterisk/trunk/lib/python/asterisk/config.py
Modified: asterisk/trunk/lib/python/asterisk/config.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/config.py?view=diff&rev=155&r1=154&r2=155
==============================================================================
--- asterisk/trunk/lib/python/asterisk/config.py (original)
+++ asterisk/trunk/lib/python/asterisk/config.py Fri Mar 26 16:41:29 2010
@@ -30,7 +30,7 @@
\s* # Leading whitespace
(?P<name>[\w|,\.-]+) # Option name
\s*=>?\s* # Separator, = or =>
- (?P<value>[\w\s=_()@|,\.-]+) # Option value
+ (?P<value>[\w\s=_()/@|,\.-]+) # Option value
(?:;.*)?$ # Optional comment before end of line
""", re.VERBOSE)
@@ -110,7 +110,8 @@
"\n" \
"[template](!)\n" \
"foo=bar\n" \
- "exten => _NXX.,n,Wait(1)\n"
+ "exten => _NXX.,n,Wait(1)\n" \
+ "astetcdir => /etc/asterisk\n"
conf = ConfigFile(fn=None, config_str=test)
@@ -139,12 +140,14 @@
self.assertEqual(conf.categories[2].name, "template")
self.assertTrue(conf.categories[2].template)
- self.assertEqual(len(conf.categories[2].options), 2)
+ self.assertEqual(len(conf.categories[2].options), 3)
self.assertEqual(conf.categories[2].options[0][0], "foo")
self.assertEqual(conf.categories[2].options[0][1], "bar")
self.assertEqual(conf.categories[2].options[1][0], "exten")
self.assertEqual(conf.categories[2].options[1][1],
"_NXX.,n,Wait(1)")
+ self.assertEqual(conf.categories[2].options[2][0], "astetcdir")
+ self.assertEqual(conf.categories[2].options[2][1], "/etc/asterisk")
def main(argv=None):
if argv is None:
More information about the asterisk-commits
mailing list