Update test code
This commit is contained in:
@ -77,6 +77,8 @@ class Able(unittest.TestCase):
|
|||||||
outfile.write(line + '\n')
|
outfile.write(line + '\n')
|
||||||
if debug:
|
if debug:
|
||||||
print "config:", result, args, kw
|
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))
|
ini = StringIO.StringIO("\n".join(result))
|
||||||
if debug:
|
if debug:
|
||||||
print "ini:", ini.readlines()
|
print "ini:", ini.readlines()
|
||||||
|
@ -11,14 +11,21 @@ namespace eval test_suite {
|
|||||||
#
|
#
|
||||||
proc test_suite::show_config {the_dict} {
|
proc test_suite::show_config {the_dict} {
|
||||||
upvar 1 $the_dict my_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] {
|
foreach s [config_reader::get_sections my_dict] {
|
||||||
set section "$s"
|
set section "$s"
|
||||||
clientput "\n\[$section\]"
|
clientput "\[$section\]"
|
||||||
foreach n [config_reader::get_variables my_dict $s] {
|
foreach n [config_reader::get_variables my_dict $s] {
|
||||||
set name "$n"
|
set name "$n"
|
||||||
set value "[config_reader::get_var my_dict $section $n]"
|
set value "[config_reader::get_var my_dict $section $n]"
|
||||||
clientput "$name = $value"
|
clientput "$name = $value"
|
||||||
}
|
}
|
||||||
|
clientput ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user