Commit 910edfae authored by Anastasios Pandis's avatar Anastasios Pandis
Browse files

set identity_service_url based on base_url, simplifying the constructor....

set identity_service_url based on base_url, simplifying the constructor. updated test configuration accordingly as it is now derived from the base_url.
parent 988e5388
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -35,16 +35,15 @@ class NetworkManager(BaseNetworkClient):

    capabilities = {"qod", "traffic_influence", "location_retrieval"}

    def __init__(self, base_url: str, scs_as_id: str = None, identity_service_url: str = None):
    def __init__(self, base_url: str, scs_as_id: str = None):
        try:
            super().__init__()
            self.base_url = base_url
            self.scs_as_id = scs_as_id
            self.identity_service_url = identity_service_url
            self.identity_service_url = f"{base_url.rstrip('/')}/3gpp-ueid/v1"
            log.info(
                f"Initialized OaiNefClient with base_url: {self.base_url} and scs_as_id: {self.scs_as_id}"
            )
            if self.identity_service_url:
            log.info(f"NEF UE-ID API URL: {self.identity_service_url}")

        except Exception as e:
+0 −6
Original line number Diff line number Diff line
@@ -374,17 +374,11 @@ class TestParseLocationResponseRealCoordinates:
#   pytest tests/network/test_location_retrieval.py -k Integration -v -s
# ============================================================

# Integration client with identity_service_url pointing at the NEF UE-ID API.
# The NEF ingress exposes /3gpp-ueid which proxies to the ue-id northbound service.
# Adjust the base URL to match your deployment.
IDENTITY_SERVICE_URL = "http://localhost:80/3gpp-ueid/v1"

client_specs_integ = {
    "network": {
        "client_name": "oai",
        "base_url": "http://localhost:80",
        "scs_as_id": "camara-test",
        "identity_service_url": IDENTITY_SERVICE_URL,
    }
}
clients_integ = sdkclient.create_adapters_from(client_specs_integ)