File tree Expand file tree Collapse file tree 5 files changed +14
-14
lines changed
test_ldm_extension/test_models Expand file tree Collapse file tree 5 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ moto = ">=5.1.6,<6.0.0"
3333pytest = " >=8.3.5,<9.0.0"
3434pytest-mock = " >=3.14.0,<4.0.0"
3535ruff = " >=0.11.2,<0.12.0"
36+ orjson = " ^3.11.3"
3637
3738[build-system ]
3839requires = [" hatchling" ]
Original file line number Diff line number Diff line change 11# (C) 2025 GoodData Corporation
2- import json
32from typing import Literal
43
4+ import orjson
55import pytest
66from gooddata_api_client .exceptions import ( # type: ignore[import]
77 NotFoundException ,
@@ -455,7 +455,7 @@ def test_permission_provisioner(
455455 f"{ TEST_DATA_SUBDIR } /existing_upstream_permissions.json"
456456 )
457457 with open (EXISTING_UPSTREAM_PERMISSIONS_PATH , "r" ) as f :
458- raw_existing_upstream_permissions = json . load ( f )
458+ raw_existing_upstream_permissions = orjson . loads ( f . read () )
459459
460460 existing_upstream_permissions = parse_expected_permissions (
461461 raw_existing_upstream_permissions
@@ -477,11 +477,11 @@ def mock_get_declarative_permissions(
477477
478478 # Load source data
479479 with open (f"{ TEST_DATA_SUBDIR } /{ source_data_path } " , "r" ) as f :
480- source_data = json . load ( f )
480+ source_data = orjson . loads ( f . read () )
481481
482482 # Load and parse expected data
483483 with open (f"{ TEST_DATA_SUBDIR } /{ expected_data_path } " , "r" ) as f :
484- raw_expected_result = json . load ( f )
484+ raw_expected_result = orjson . loads ( f . read () )
485485
486486 expected_result = parse_expected_permissions (raw_expected_result )
487487
Original file line number Diff line number Diff line change 11# (C) 2025 GoodData Corporation
2- import json
32from dataclasses import dataclass
43from typing import Literal , Optional
54
5+ import orjson
66import pytest
77from gooddata_api_client .exceptions import NotFoundException # type: ignore
88from gooddata_sdk .catalog .user .entity_model .user import (
@@ -225,15 +225,15 @@ def test_user_provisioning(
225225
226226 # Load input data
227227 with open (f"{ TEST_DATA_SUBDIR } /{ input_path } " , "r" ) as f :
228- input_data = json . load ( f )
228+ input_data = orjson . loads ( f . read () )
229229
230230 # Load expected data
231231 with open (f"{ TEST_DATA_SUBDIR } /{ expected_path } " , "r" ) as f :
232- raw_expected_data = json . load ( f )
232+ raw_expected_data = orjson . loads ( f . read () )
233233
234234 # Load and patch "existing users"
235235 with open (f"{ TEST_DATA_SUBDIR } /existing_upstream_users.json" , "r" ) as f :
236- raw_upstream_users = json . load ( f )
236+ raw_upstream_users = orjson . loads ( f . read () )
237237
238238 upstream_users = parse_user_data (raw_upstream_users )
239239
Original file line number Diff line number Diff line change 11# (C) 2025 GoodData Corporation
22
3- import json
43from typing import Any
54
5+ import orjson
66import pytest
77from pydantic import ValidationError
88from requests import Response
@@ -67,7 +67,7 @@ def test_get_wdf_settings_for_workspace_valid_payload(
6767
6868 payload = WDF_VALID_PAYLOAD
6969
70- mock_response ._content = json .dumps (payload ). encode ( "utf-8" )
70+ mock_response ._content = orjson .dumps (payload )
7171
7272 mocker .patch .object (
7373 mock_gooddata_api ,
@@ -102,7 +102,7 @@ def test_get_wdf_settings_for_workspace_invalid_payload(
102102 ]
103103 }
104104
105- mock_response ._content = json .dumps (payload ). encode ( "utf-8" )
105+ mock_response ._content = orjson .dumps (payload )
106106
107107 mocker .patch .object (
108108 mock_gooddata_api ,
Original file line number Diff line number Diff line change 11# (C) 2025 GoodData Corporation
2- import json
3-
2+ import orjson
43import pytest
54
65from gooddata_pipelines .ldm_extension .models .analytical_object import (
2019)
2120def test_analytical_object_model_with_metrics (file_path ):
2221 with open (file_path , "r" ) as file :
23- data = json . load (file )
22+ data = orjson . loads (file . read () )
2423 analytical_objects = AnalyticalObjects (** data )
2524 assert isinstance (analytical_objects , AnalyticalObjects )
2625 assert isinstance (analytical_objects .data , list )
You can’t perform that action at this time.
0 commit comments