def test_parsing(self): """Test config file parsing.""" config = WeblateConfig() self.assertEqual(config.get("weblate", "url"), wlc.API_URL) config.load() config.load(TEST_CONFIG) self.assertEqual(config.get("weblate", "url"), "https://example.net/")
def test_default_config_values(self): """Test default parser values.""" config = WeblateConfig() self.assertEqual(config.get("weblate", "key"), "") self.assertEqual(config.get("weblate", "retries"), 0) self.assertEqual( config.get("weblate", "method_whitelist"), "HEAD\nTRACE\nDELETE\nOPTIONS\nPUT\nGET", ) self.assertEqual(config.get("weblate", "backoff_factor"), 0) self.assertEqual(config.get("weblate", "status_forcelist"), None)
def test_parsing(self): """Test config file parsing.""" config = WeblateConfig() self.assertEqual(config.get("weblate", "url"), wlc.API_URL) config.load() config.load(TEST_CONFIG) self.assertEqual(config.get("weblate", "url"), "https://example.net/") self.assertEqual(config.get("weblate", "retries"), "999") self.assertEqual(config.get("weblate", "method_whitelist"), "PUT,POST") self.assertEqual(config.get("weblate", "backoff_factor"), "0.2") self.assertEqual(config.get("weblate", "status_forcelist"), "429,500,502,503,504")