How to use the ptr._config_read function in ptr

To help you get started, we’ve selected a few ptr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facebookincubator / ptr / ptr_tests.py View on Github external
def test_config(self) -> None:
        expected_pypi_url = "https://pypi.org/simple/"
        dc = ptr._config_default()
        self.assertEqual(dc["ptr"]["pypi_url"], expected_pypi_url)
        dc["ptr"]["cpu_count"] = "10"

        td = Path(__file__).parent
        sc = ptr._config_read(str(td), "ptrconfig.sample")
        self.assertEqual(sc["ptr"].get("pypi_url", ""), expected_pypi_url)
        self.assertEqual(len(sc["ptr"].get("venv_pkgs", "").split()), 8)