Преглед изворни кода

Code cleanup in test_tools

oz123 пре 10 година
родитељ
комит
7738c737ce
1 измењених фајлова са 6 додато и 3 уклоњено
  1. 6 3
      pwman/tests/test_tools.py

+ 6 - 3
pwman/tests/test_tools.py

@@ -53,8 +53,7 @@ default_config['Database'] = {'type': 'SQLite',
                                            "test.pwman.db")
                                            "test.pwman.db")
                               }
                               }
 
 
-with open(os.path.join(os.path.dirname(__file__), 'test.conf'), 'w') as f:
-    f.write("""
+dc = """
 [Global]
 [Global]
 xsel = /usr/bin/xsel
 xsel = /usr/bin/xsel
 colors = yes
 colors = yes
@@ -63,12 +62,16 @@ cls_timeout = 5
 
 
 [Database]
 [Database]
 type = SQLite
 type = SQLite
-""")
+"""
 
 
 
 
 class SetupTester(object):
 class SetupTester(object):
 
 
     def __init__(self, dbver=None, filename=None):
     def __init__(self, dbver=None, filename=None):
+
+        f = open(os.path.join(os.path.dirname(__file__), 'test.conf'), 'w')
+        f.write(dc)
+        f.close()
         self.configp = config.Config(os.path.join(os.path.dirname(__file__),
         self.configp = config.Config(os.path.join(os.path.dirname(__file__),
                                                   "test.conf"),
                                                   "test.conf"),
                                      default_config)
                                      default_config)