예제 #1
0
 def test_no_global_section(self):
     config = ConfigParser()
     file_name = os.path.join(self.test_dir, "file")
     with open(file_name, 'wt') as fp:
         fp.write("user2 = mysql")
     config.read(file_name)
     value = config.get("global", "user2")
     assert value == "mysql"
예제 #2
0
 def test_whitespace_as_underscore(self):
     config = ConfigParser()
     file_name = os.path.join(self.test_dir, "file")
     with open(file_name, 'wt') as fp:
         fp.write("[mysqld]\n")
         fp.write("user_2 = mysql\n")
     config.read(file_name)
     value = config.get("mysqld", "user_2")
     assert value == "mysql"