From: Trent M. <tr...@gm...> - 2007-11-06 05:32:48
|
On 11/5/07, Waylan Limberg <wa...@gm...> wrote: > After working on safe_mode to add escaping, I realized that there's no > way to test safe_mode in the testing framework. A few possibilities > occurred to me. The way I do it in markdown2.py's test suite is to have a "foo.opts" file beside the "foo.txt" and "foo.html". The test harness looks for a corresponding ".opts" file, reads it, evals it as Python (it must be a Python dict) and passes it to the convert function via kwargs. For example: http://python-markdown2.googlecode.com/svn/trunk/test/tm-cases/safe_mode.text http://python-markdown2.googlecode.com/svn/trunk/test/tm-cases/safe_mode.html http://python-markdown2.googlecode.com/svn/trunk/test/tm-cases/safe_mode.opts > Thing is, the same text files could easily work with each of the > possible modes. So another option would be to include additional html > files in the existing directories with a special name (ie, > "escaped-somefile.html). If those files exist, then additional tests > would be run in the appropriate mode. I've tried that before -- in another project -- and found it too limiting. For example, this kind of this couldn't be done: http://python-markdown2.googlecode.com/svn/trunk/test/tm-cases/link_patterns.opts Cheers, Trent -- Trent Mick tr...@gm... |