home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 April / PCWorld_2001-04_cd.bin / Software / TemaCD / webclean / !!!python!!! / BeOpen-Python-2.0.exe / TEST_CFGPARSER < prev    next >
Encoding:
Text File  |  2000-09-27  |  1.6 KB  |  52 lines

  1. test_cfgparser
  2.  
  3. Testing basic accessors...
  4. ['Commented Bar', 'Foo Bar', 'Spacey Bar']
  5. Commented Bar: ['foo']
  6. Foo Bar: ['foo']
  7. Spacey Bar: ['foo']
  8. 'bar'
  9. 'bar'
  10. 'bar'
  11. __name__ "option" properly hidden by the API.
  12.  
  13. Testing value interpolation...
  14. 'Foo'
  15. 'something with interpolation (1 step)'
  16. 'something with lots of interpolation (9 steps)'
  17. 'something with lots of interpolation (10 steps)'
  18. Caught expected InterpolationDepthError :
  19. Value interpolation too deeply recursive:
  20.     section: [Foo]
  21.     option : bar11
  22.     rawval : something %(with11)s lots of interpolation (11 steps)
  23.  
  24.  
  25. Testing for parsing errors...
  26. Caught expected exception: File contains parsing errors: <???>
  27.     [line  2]: '  extra-spaces: splat\012'
  28. Caught expected exception: File contains parsing errors: <???>
  29.     [line  2]: '  extra-spaces= splat\012'
  30. Caught expected exception: File contains parsing errors: <???>
  31.     [line  2]: 'option-without-value\012'
  32. Caught expected exception: File contains parsing errors: <???>
  33.     [line  2]: ':value-without-option-name\012'
  34. Caught expected exception: File contains parsing errors: <???>
  35.     [line  2]: '=value-without-option-name\012'
  36. Caught expected exception: File contains no section headers.
  37. file: <???>, line: 1
  38. 'No Section!\012'
  39.  
  40. Testing query interface...
  41. []
  42. Has section 'Foo'? 0
  43. Caught expected NoSectionError: No section: Foo
  44. Caught expected NoSectionError: No section: foo
  45. Caught expected NoSectionError :
  46. No section: foo
  47. Caught expected NoOptionError :
  48. No option `bar' in section: foo
  49.  
  50. Testing miscellaneous error conditions...
  51. Caught expected DuplicateSectionError: Section Foo already exists
  52.