Sfoglia il codice sorgente

Code cleanup in test_tools

oz123 10 anni fa
parent
commit
7738c737ce
1 ha cambiato i file con 6 aggiunte e 3 eliminazioni
  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")
                               }
 
-with open(os.path.join(os.path.dirname(__file__), 'test.conf'), 'w') as f:
-    f.write("""
+dc = """
 [Global]
 xsel = /usr/bin/xsel
 colors = yes
@@ -63,12 +62,16 @@ cls_timeout = 5
 
 [Database]
 type = SQLite
-""")
+"""
 
 
 class SetupTester(object):
 
     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__),
                                                   "test.conf"),
                                      default_config)