def METHOD_NAME(self, mock_TDSCatalog):
    sds = SpatialDatasetService(
        name="test_sds",
        engine=SpatialDatasetService.THREDDS,
        endpoint="http://localhost/thredds/",
        public_endpoint="http://publichost/thredds/",
        apikey="test_api",
        username="foo",
        password="password",
    )
    sds.save()
    sds_setting = self.test_app.settings_set.select_subclasses().get(
        name="primary_thredds"
    )
    sds_setting.spatial_dataset_service = sds
    sds_setting.save()
    # Check as_engine
    ret = (
        self.test_app.settings_set.select_subclasses()
        .get(name="primary_thredds")
        .get_value(as_engine=True)
    )
    # Check result
    mock_TDSCatalog.assert_called_with("http://localhost/thredds/catalog.xml")
    self.assertEqual(mock_TDSCatalog(), ret)
    # Check as wms
    ret = (
        self.test_app.settings_set.select_subclasses()
        .get(name="primary_thredds")
        .get_value(as_wms=True)
    )
    # Check result
    self.assertEqual("http://localhost/thredds/wms", ret)
    # Check as wfs
    self.assertRaises(
        ValueError,
        self.test_app.settings_set.select_subclasses()
        .get(name="primary_thredds")
        .get_value,
        as_wfs=True,
    )
    # Check as wcs
    ret = (
        self.test_app.settings_set.select_subclasses()
        .get(name="primary_thredds")
        .get_value(as_wcs=True)
    )
    # Check result
    self.assertEqual("http://localhost/thredds/wcs", ret)
    # Check as_endpoint
    ret = (
        self.test_app.settings_set.select_subclasses()
        .get(name="primary_thredds")
        .get_value(as_endpoint=True)
    )
    # Check result
    self.assertEqual("http://localhost/thredds/", ret)
    # Check as_endpoint
    ret = (
        self.test_app.settings_set.select_subclasses()
        .get(name="primary_thredds")
        .get_value(as_public_endpoint=True)
    )
    # Check result
    self.assertEqual("http://publichost/thredds/", ret)