Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 62 additions & 1 deletion tests/test_commands/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
ItemType.REFLEX, ItemType.REPORT,
ItemType.SQL_DATABASE, ItemType.SEMANTIC_MODEL,
ItemType.SPARK_JOB_DEFINITION, ItemType.WAREHOUSE, ItemType.COPYJOB,
ItemType.GRAPHQLAPI, ItemType.DATAFLOW,
ItemType.GRAPHQLAPI, ItemType.DATAFLOW, ItemType.COSMOS_DB_DATABASE,
ItemType.USER_DATA_FUNCTION, ItemType.GRAPH_QUERY_SET, ItemType.DIGITAL_TWIN_BUILDER
])

basic_item_parametrize = pytest.mark.parametrize("item_type", [
Expand All @@ -60,6 +61,66 @@
ItemType.REFLEX, ItemType.SPARK_JOB_DEFINITION,
])

set_item_metadata_success_params_complete = pytest.mark.parametrize(
"metadata_to_set,should_upsert_to_cache",
[
("description", False),
("displayName", True),
],
)

set_item_metadata_for_all_types_success_item_params = pytest.mark.parametrize("item_type", [
ItemType.DATA_PIPELINE, ItemType.ENVIRONMENT, ItemType.EVENTSTREAM,
ItemType.KQL_DASHBOARD, ItemType.KQL_QUERYSET, ItemType.ML_EXPERIMENT,
ItemType.NOTEBOOK, ItemType.REFLEX, ItemType.SPARK_JOB_DEFINITION,
ItemType.USER_DATA_FUNCTION, ItemType.DIGITAL_TWIN_BUILDER
])

set_item_metadata_success_params = pytest.mark.parametrize(
"metadata_to_set", ["description", "displayName"])

set_workspace_success_params = pytest.mark.parametrize(
"metadata_to_set, input_value",
[
("sparkSettings.automaticLog.enabled", "false"),
],
)

set_sparkpool_success_params = pytest.mark.parametrize(
"metadata_to_set, input_value",
[
("nodeSize", "Medium"),
("autoScale.enabled", "True"),
("autoScale.minNodeCount", "2"),
("autoScale.maxNodeCount", "5"),
("name", None), # Use None to trigger generate_random_string
],
)

set_capacity_success_params = pytest.mark.parametrize(
"query, input", [("sku.name", "F4")])

set_domain_success_params = pytest.mark.parametrize(
"query, input", [("contributorsScope", "AdminsOnly")])

set_connection_metadata_success_params = pytest.mark.parametrize(
"metadata_to_set,input_value",
[
("privacyLevel", "Organizational"),
],
)

set_gateway_virtualNetwork_success_params = pytest.mark.parametrize(
"query,input",
[
("numberOfMemberGateways", "2"),
("inactivityMinutesBeforeSleep", "60"),
("displayName", None), # Use None to trigger generate_random_string
],
)

set_folder_success_params = pytest.mark.parametrize(
"query, input", [("displayName", "randomFolder")])
# Export command parametrizations
export_item_with_extension_parameters = pytest.mark.parametrize("item_type,expected_file_extension", [
(ItemType.NOTEBOOK, ".ipynb"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ interactions:
Content-Encoding:
- gzip
Content-Length:
- '2803'
- '2906'
Content-Type:
- application/json; charset=utf-8
Date:
- Thu, 05 Feb 2026 14:01:21 GMT
- Wed, 11 Feb 2026 08:03:55 GMT
Pragma:
- no-cache
RequestId:
- aff15532-9dd4-496c-8744-96133d51a224
- 78a45eaa-df2e-42b9-a152-b016c949c59a
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
X-Content-Type-Options:
Expand Down Expand Up @@ -75,15 +75,15 @@ interactions:
Content-Encoding:
- gzip
Content-Length:
- '2803'
- '2906'
Content-Type:
- application/json; charset=utf-8
Date:
- Thu, 05 Feb 2026 14:01:21 GMT
- Wed, 11 Feb 2026 08:03:55 GMT
Pragma:
- no-cache
RequestId:
- a4000f1e-6466-4176-912f-d70444a52d41
- ebf784e9-a2f3-43d8-97e4-6642f6f3a893
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
X-Content-Type-Options:
Expand Down Expand Up @@ -129,11 +129,11 @@ interactions:
Content-Type:
- application/json; charset=utf-8
Date:
- Thu, 05 Feb 2026 14:01:26 GMT
- Wed, 11 Feb 2026 08:03:59 GMT
Pragma:
- no-cache
RequestId:
- d6cb0ef2-c383-43d0-affa-865820307391
- 2c18461f-f08c-4b2f-85d7-5a701e9aa873
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
X-Content-Type-Options:
Expand Down Expand Up @@ -167,7 +167,7 @@ interactions:
uri: https://api.fabric.microsoft.com/v1/workspaces
response:
body:
string: '{"id": "464e064d-4767-4181-8a32-bba9797c4ad1", "displayName": "fabriccli_WorkspacePerTestclass_000001",
string: '{"id": "ebc4005f-d298-4926-9fbf-3f99130d4b00", "displayName": "fabriccli_WorkspacePerTestclass_000001",
"description": "Created by fab", "type": "Workspace", "capacityId": "00000000-0000-0000-0000-000000000004"}'
headers:
Access-Control-Expose-Headers:
Expand All @@ -177,17 +177,17 @@ interactions:
Content-Encoding:
- gzip
Content-Length:
- '188'
- '187'
Content-Type:
- application/json; charset=utf-8
Date:
- Thu, 05 Feb 2026 14:01:34 GMT
- Wed, 11 Feb 2026 08:04:07 GMT
Location:
- https://api.fabric.microsoft.com/v1/workspaces/464e064d-4767-4181-8a32-bba9797c4ad1
- https://api.fabric.microsoft.com/v1/workspaces/ebc4005f-d298-4926-9fbf-3f99130d4b00
Pragma:
- no-cache
RequestId:
- 27bd9dea-5135-45c7-bfa3-3102a1156c23
- 61609a16-c311-4a31-8fbd-90a178d2a0a5
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
X-Content-Type-Options:
Expand Down Expand Up @@ -219,7 +219,7 @@ interactions:
response:
body:
string: '{"value": [{"id": "3634a139-2c9e-4205-910b-3b089a31be47", "displayName":
"My workspace", "description": "", "type": "Personal"}, {"id": "464e064d-4767-4181-8a32-bba9797c4ad1",
"My workspace", "description": "", "type": "Personal"}, {"id": "ebc4005f-d298-4926-9fbf-3f99130d4b00",
"displayName": "fabriccli_WorkspacePerTestclass_000001", "description": "Created
by fab", "type": "Workspace", "capacityId": "00000000-0000-0000-0000-000000000004"}]}'
headers:
Expand All @@ -230,15 +230,15 @@ interactions:
Content-Encoding:
- gzip
Content-Length:
- '2804'
- '2939'
Content-Type:
- application/json; charset=utf-8
Date:
- Thu, 05 Feb 2026 14:01:43 GMT
- Wed, 11 Feb 2026 08:05:22 GMT
Pragma:
- no-cache
RequestId:
- f7c56eed-e69a-4c34-a2bc-f4e98cf04674
- fa60c476-11cc-453d-82c6-d7578c1e4125
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
X-Content-Type-Options:
Expand Down Expand Up @@ -266,7 +266,7 @@ interactions:
User-Agent:
- ms-fabric-cli/1.3.1 (set; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
method: GET
uri: https://api.fabric.microsoft.com/v1/workspaces/464e064d-4767-4181-8a32-bba9797c4ad1/items
uri: https://api.fabric.microsoft.com/v1/workspaces/ebc4005f-d298-4926-9fbf-3f99130d4b00/items
response:
body:
string: '{"value": []}'
Expand All @@ -282,11 +282,11 @@ interactions:
Content-Type:
- application/json; charset=utf-8
Date:
- Thu, 05 Feb 2026 14:01:43 GMT
- Wed, 11 Feb 2026 08:05:23 GMT
Pragma:
- no-cache
RequestId:
- d3a0068d-965a-49e0-a479-3e89e2653e06
- dc2e7fea-cb38-4449-b800-482ceefb365e
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
X-Content-Type-Options:
Expand Down Expand Up @@ -316,7 +316,7 @@ interactions:
User-Agent:
- ms-fabric-cli/1.3.1 (set; Linux; x86_64; 6.6.87.2-microsoft-standard-WSL2)
method: DELETE
uri: https://api.fabric.microsoft.com/v1/workspaces/464e064d-4767-4181-8a32-bba9797c4ad1
uri: https://api.fabric.microsoft.com/v1/workspaces/ebc4005f-d298-4926-9fbf-3f99130d4b00
response:
body:
string: ''
Expand All @@ -332,11 +332,11 @@ interactions:
Content-Type:
- application/octet-stream
Date:
- Thu, 05 Feb 2026 14:01:43 GMT
- Wed, 11 Feb 2026 08:05:24 GMT
Pragma:
- no-cache
RequestId:
- ebe586ae-81a2-445e-96f7-0d2b03b9a5c3
- 0a5e091c-d126-4f21-b562-822331f90efe
Strict-Transport-Security:
- max-age=31536000; includeSubDomains
X-Content-Type-Options:
Expand Down
Loading