Update test code

This commit is contained in:
Douglas Clowes
2014-05-29 13:44:57 +10:00
parent 1a1f00c49a
commit 61700fbae3
2 changed files with 10 additions and 1 deletions

View File

@ -77,6 +77,8 @@ class Able(unittest.TestCase):
outfile.write(line + '\n')
if debug:
print "config:", result, args, kw
self.assertFalse(result[0].startswith("can't read"))
self.assertFalse(result[0].startswith("... No dictionary ..."))
ini = StringIO.StringIO("\n".join(result))
if debug:
print "ini:", ini.readlines()

View File

@ -11,14 +11,21 @@ namespace eval test_suite {
#
proc test_suite::show_config {the_dict} {
upvar 1 $the_dict my_dict
if { ![info exists my_dict] } {
clientput "\[config\]"
clientput "missing = True"
clientput "present = False"
return
}
foreach s [config_reader::get_sections my_dict] {
set section "$s"
clientput "\n\[$section\]"
clientput "\[$section\]"
foreach n [config_reader::get_variables my_dict $s] {
set name "$n"
set value "[config_reader::get_var my_dict $section $n]"
clientput "$name = $value"
}
clientput ""
}
}