Example #1
0
 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/")
Example #2
0
 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)
Example #3
0
 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")