コード例 #1
0
def test_apm_host_when_the_apm_setting_is_present_without_endpoint():
    s = SettingsData(1, {
        "settings": [{
            "name": "apm",
            "enabled": True,
        }],
    })
    assert s.apm_host() is None
コード例 #2
0
def test_apm_host_when_the_apm_setting_is_present():
    s = SettingsData(
        1, {
            "settings": [{
                "name": "apm",
                "enabled": True,
                "endpoint": "http://api.example.com",
            }],
        })
    assert s.apm_host() == "http://api.example.com"
コード例 #3
0
def test_apm_host_when_the_apm_setting_is_missing():
    s = SettingsData(1, {
        "settings": [],
    })
    assert s.apm_host() is None