clean up temporary conf file

This commit is contained in:
jleute 2018-05-19 02:42:45 +02:00
parent e00238427b
commit cfe5eb5d56

View file

@ -5,7 +5,7 @@ from twisted.trial import unittest
from lbrynet import conf from lbrynet import conf
from lbrynet.core.Error import InvalidCurrencyError from lbrynet.core.Error import InvalidCurrencyError
from lbrynet.tests import mocks from lbrynet.tests import mocks
from lbrynet.tests.util import create_conf_file from lbrynet.tests.util import create_conf_file, remove_conf_file
class SettingsTest(unittest.TestCase): class SettingsTest(unittest.TestCase):
def setUp(self): def setUp(self):
@ -93,6 +93,12 @@ class SettingsTest(unittest.TestCase):
settings.load_conf_file_settings() settings.load_conf_file_settings()
first = settings.get('lbryum_servers', data_type=conf.TYPE_PERSISTED) first = settings.get('lbryum_servers', data_type=conf.TYPE_PERSISTED)
settings.save_conf_file_settings() settings.save_conf_file_settings()
try:
settings.load_conf_file_settings() settings.load_conf_file_settings()
except Exception, e:
remove_conf_file(conf_temp)
raise Exception(e)
second = settings.get('lbryum_servers', data_type=conf.TYPE_PERSISTED) second = settings.get('lbryum_servers', data_type=conf.TYPE_PERSISTED)
remove_conf_file(conf_temp)
self.assertEqual(first, second) self.assertEqual(first, second)