use py2-style ConfigParser-set and section_add in tests

This commit is contained in:
Thor77 2016-05-09 19:34:13 +02:00
parent 6e7922492a
commit 6889946ab6
1 changed files with 3 additions and 1 deletions

View File

@ -16,7 +16,9 @@ configpath = abspath('tsstats/tests/res/test.cfg')
def create_config(values, key='General'):
config = ConfigParser()
config[key] = values
config.add_section('General')
for option, value in values.items():
config.set('General', option, value)
with open(configpath, 'w') as configfile:
config.write(configfile)