Example #1
0
 def test_can_fill_db_setting_from_config(self):
     config = TestConfiguration.from_configstring('[db]\nscheme=postgresql\nhost=localhost\nuser=root\npasword=fnord')
     self.assert_not_none(config)
     db = config.db()
     self.assert_equals('postgresql', db.scheme)
     self.assert_equals('localhost', db.host)
     self.assert_equals('root', db.user)
     self.assert_equals(None, db.password)
Example #2
0
 def test_can_fill_db_setting_from_config(self):
     config = TestConfiguration.from_configstring(
         "[db]\nscheme=postgresql\nhost=localhost\nuser=root\npasword=fnord"
     )
     self.assert_not_none(config)
     db = config.db()
     self.assert_equals("postgresql", db.scheme)
     self.assert_equals("localhost", db.host)
     self.assert_equals("root", db.user)
     self.assert_equals(None, db.password)
Example #3
0
 def test_can_parse_ini(self):
     config = TestConfiguration.from_configstring('[db]\nfoo=bar')
     self.assert_not_none(config)
     self.assert_equals(dict(host='localhost', user=None, password=None, 
                             scheme='sqlite'), 
                        config.db())
Example #4
0
 def test_can_parse_ini(self):
     config = TestConfiguration.from_configstring("[db]\nfoo=bar")
     self.assert_not_none(config)
     self.assert_equals(dict(host="localhost", user=None, password=None, scheme="sqlite"), config.db())