Ejemplo n.º 1
0
def test_error_host_when_the_errors_setting_is_present_without_endpoint():
    s = SettingsData(1, {
        "settings": [{
            "name": "errors",
            "enabled": True,
        }],
    })
    assert s.error_host() is None
Ejemplo n.º 2
0
def test_error_host_when_the_errors_setting_is_present():
    s = SettingsData(
        1, {
            "settings": [{
                "name": "errors",
                "enabled": True,
                "endpoint": "http://api.example.com",
            }],
        })
    assert s.error_host() == "http://api.example.com"
Ejemplo n.º 3
0
def test_error_host_when_the_errors_setting_is_missing():
    s = SettingsData(1, {
        "settings": [],
    })
    assert s.error_host() is None