def test_optional_json_does_not_throw(self):
        config = Configuration()

        not_existing_file = f"{uuid4()}.json"

        config.add_json_file(not_existing_file, optional=True)

        assert True is True
    def test_add_json_file(self):
        filepath = pkg_resources.resource_filename(__name__,
                                                   "./json_example_01.json")

        config = Configuration()
        config.add_json_file(filepath)

        assert (config.ApplicationInsights.InstrumentationKey ==
                "742dc2e1-3f6f-447a-b710-6bf61d6e8a3c")
        assert config.Authentication.B2C[0].IssuerName == "example"
        assert config.Logging.IncludeScopes is False

        for b2c_conf in config.Authentication.B2C:
            assert b2c_conf.IssuerName.startswith("example")
    def test_missing_file_error(self):
        config = Configuration()

        filepath = pkg_resources.resource_filename(__name__,
                                                   "./not_existing.foo")

        assert not os.path.exists(filepath)

        with pytest.raises(FileNotFoundError):
            config.add_ini_file(filepath)

        with pytest.raises(FileNotFoundError):
            config.add_json_file(filepath)

        with pytest.raises(FileNotFoundError):
            config.add_yaml_file(filepath)