def test_config_route_when_it_is_empty(): s = SettingsData(1, {"config_route": ""}) assert s.config_route("http://example.com") == ( "http://example.com/2020-06-18/config/1/config.json")
def test_config_route_when_it_is_specified(): s = SettingsData(1, {"config_route": "123/cfg/321/cfg.json"}) assert s.config_route("http://example.com") == ( "http://example.com/123/cfg/321/cfg.json")
def test_config_route_when_the_given_host_ends_with_a_trailing_slash(): s = SettingsData(1, {}) assert s.config_route("http://example.com/") == ( "http://example.com/2020-06-18/config/1/config.json")
def test_config_route_when_missing(): s = SettingsData(1, {}) assert s.config_route("http://example.com") == ( "http://example.com/2020-06-18/config/1/config.json")