2022-05-24 11:18:20 -05:00
|
|
|
import json
|
|
|
|
|
|
|
|
from datahub.cli.cli_utils import get_aspects_for_entity
|
|
|
|
|
|
|
|
|
2024-09-27 11:31:25 -05:00
|
|
|
def test_no_client_id(graph_client):
|
2022-05-24 11:18:20 -05:00
|
|
|
client_id_urn = "urn:li:telemetry:clientId"
|
2024-01-31 14:42:40 +05:30
|
|
|
aspect = [
|
|
|
|
"clientId"
|
|
|
|
] # this is checking for the removal of the invalid aspect RemoveClientIdAspectStep.java
|
2024-01-22 11:46:04 -06:00
|
|
|
|
|
|
|
res_data = json.dumps(
|
2024-07-25 20:06:14 +01:00
|
|
|
get_aspects_for_entity(
|
2024-09-27 11:31:25 -05:00
|
|
|
session=graph_client._session,
|
|
|
|
gms_host=graph_client.config.server,
|
2024-07-25 20:06:14 +01:00
|
|
|
entity_urn=client_id_urn,
|
|
|
|
aspects=aspect,
|
|
|
|
typed=False,
|
|
|
|
)
|
2024-01-22 11:46:04 -06:00
|
|
|
)
|
|
|
|
assert res_data == "{}"
|
|
|
|
|
|
|
|
|
2024-09-27 11:31:25 -05:00
|
|
|
def test_no_telemetry_client_id(graph_client):
|
2024-01-22 11:46:04 -06:00
|
|
|
client_id_urn = "urn:li:telemetry:clientId"
|
|
|
|
aspect = ["telemetryClientId"] # telemetry expected to be disabled for tests
|
2022-05-24 11:18:20 -05:00
|
|
|
|
2023-10-10 16:08:34 +05:30
|
|
|
res_data = json.dumps(
|
2024-07-25 20:06:14 +01:00
|
|
|
get_aspects_for_entity(
|
2024-09-27 11:31:25 -05:00
|
|
|
session=graph_client._session,
|
|
|
|
gms_host=graph_client.config.server,
|
2024-07-25 20:06:14 +01:00
|
|
|
entity_urn=client_id_urn,
|
|
|
|
aspects=aspect,
|
|
|
|
typed=False,
|
|
|
|
)
|
2023-10-10 16:08:34 +05:30
|
|
|
)
|
2022-05-24 11:18:20 -05:00
|
|
|
assert res_data == "{}"
|