Skip to content

Commit dc276c9

Browse files
Alon YeshurunCopilot
andcommitted
fix: add _success/_failure suffix to all test names in test_fab_hiearchy.py
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 85a46d2 commit dc276c9

1 file changed

Lines changed: 27 additions & 27 deletions

File tree

tests/test_core/test_fab_hiearchy.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
)
1717

1818

19-
def test_create_tenant():
19+
def test_create_tenant_success():
2020
tenant = Tenant(name="tenant_name", id="0000")
2121
assert tenant.id == "0000"
2222
assert tenant.name == "tenant_name.Tenant"
@@ -26,7 +26,7 @@ def test_create_tenant():
2626
assert tenant.check_command_support(Command.FS_LS)
2727

2828

29-
def test_create_workspace():
29+
def test_create_workspace_success():
3030
tenant = Tenant(name="tenant_name", id="0000")
3131
workspace = Workspace(
3232
name="workspace_name", id="workspace_id", parent=tenant, type="Workspace"
@@ -43,7 +43,7 @@ def test_create_workspace():
4343
assert str(workspace) == "[Workspace] (workspace_name, workspace_id)"
4444

4545

46-
def test_create_invalid_workspace():
46+
def test_create_invalid_workspace_failure():
4747
tenant = Tenant(name="tenant_name", id="0000")
4848

4949
with pytest.raises(FabricCLIError) as e:
@@ -53,7 +53,7 @@ def test_create_invalid_workspace():
5353
assert e.value.status_code == fab_constant.ERROR_INVALID_WORKSPACE_TYPE
5454

5555

56-
def test_create_virtual_workspace():
56+
def test_create_virtual_workspace_success():
5757
tenant = Tenant(name="tenant_name", id="0000")
5858
workspace = VirtualWorkspace(
5959
name=".capacities", id="virtual_workspace_id", parent=tenant
@@ -69,15 +69,15 @@ def test_create_virtual_workspace():
6969
assert workspace.check_command_support(Command.FS_LS)
7070

7171

72-
def test_create_invalid_virtual_workspace():
72+
def test_create_invalid_virtual_workspace_failure():
7373
tenant = Tenant(name="tenant_name", id="0000")
7474

7575
with pytest.raises(FabricCLIError) as e:
7676
VirtualWorkspace(name="_invalid", id="workspace_id", parent=tenant)
7777
assert e.value.status_code == fab_constant.ERROR_INVALID_WORKSPACE_TYPE
7878

7979

80-
def test_create_item():
80+
def test_create_item_success():
8181
tenant = Tenant(name="tenant_name", id="0000")
8282
workspace = Workspace(
8383
name="workspace_name", id="workspace_id", parent=tenant, type="Workspace"
@@ -107,7 +107,7 @@ def test_create_item():
107107
assert e.value.status_code == fab_constant.ERROR_UNSUPPORTED_COMMAND
108108

109109

110-
def test_create_invalid_item():
110+
def test_create_invalid_item_failure():
111111
tenant = Tenant(name="tenant_name", id="0000")
112112
workspace = Workspace(
113113
name="workspace_name", id="workspace_id", parent=tenant, type="Workspace"
@@ -132,7 +132,7 @@ def test_create_invalid_item():
132132
assert e.value.status_code == fab_constant.WARNING_INVALID_ITEM_NAME
133133

134134

135-
def test_create_virtual_item():
135+
def test_create_virtual_item_success():
136136
tenant = Tenant(name="tenant_name", id="0000")
137137
workspace = Workspace(
138138
name="My workspace", id="workspace_id", parent=tenant, type="Personal"
@@ -159,7 +159,7 @@ def test_create_virtual_item():
159159
assert item.check_command_support(Command.FS_EXISTS)
160160

161161

162-
def test_create_virtual_workspace_item():
162+
def test_create_virtual_workspace_item_success():
163163
tenant = Tenant(name="tenant_name", id="0000")
164164
workspace = VirtualWorkspace(
165165
name=".capacities", id="virtual_workspace_id", parent=tenant
@@ -183,7 +183,7 @@ def test_create_virtual_workspace_item():
183183
assert item.check_command_support(Command.FS_EXISTS)
184184

185185

186-
def test_create_onelakeelement():
186+
def test_create_onelakeelement_success():
187187
tenant = Tenant(name="tenant_name", id="0000")
188188
workspace = Workspace(
189189
name="workspace_name", id="workspace_id", parent=tenant, type="Workspace"
@@ -270,7 +270,7 @@ def test_create_onelakeelement():
270270
assert onelake_file != onelake_copy
271271

272272

273-
def test_create_invalid_virtualworkspace_item_type():
273+
def test_create_invalid_virtualworkspace_item_type_failure():
274274
tenant = Tenant(name="tenant_name", id="0000")
275275
workspace = VirtualWorkspace(
276276
name=".capacities", id="virtual_workspace_id", parent=tenant
@@ -286,15 +286,15 @@ def test_create_invalid_virtualworkspace_item_type():
286286
assert e.value.status_code == fab_constant.ERROR_INVALID_ITEM_TYPE
287287

288288

289-
def test_create_invalid_virtualworkspace():
289+
def test_create_invalid_virtualworkspace_failure():
290290
tenant = Tenant(name="tenant_name", id="0000")
291291

292292
with pytest.raises(FabricCLIError) as e:
293293
VirtualWorkspace(name="_invalid", id="workspace_id", parent=tenant)
294294
assert e.value.status_code == fab_constant.ERROR_INVALID_WORKSPACE_TYPE
295295

296296

297-
def test_create_invalid_virtual_item_container():
297+
def test_create_invalid_virtual_item_container_failure():
298298
tenant = Tenant(name="tenant_name", id="0000")
299299
workspace = Workspace(
300300
name="workspace_name", id="workspace_id", parent=tenant, type="Personal"
@@ -305,7 +305,7 @@ def test_create_invalid_virtual_item_container():
305305
assert e.value.status_code == fab_constant.ERROR_INVALID_ITEM_TYPE
306306

307307

308-
def test_create_invalid_virtual_item():
308+
def test_create_invalid_virtual_item_failure():
309309
tenant = Tenant(name="tenant_name", id="0000")
310310
workspace = Workspace(
311311
name="workspace_name", id="workspace_id", parent=tenant, type="Workspace"
@@ -324,7 +324,7 @@ def test_create_invalid_virtual_item():
324324
assert e.value.status_code == fab_constant.ERROR_INVALID_ITEM_TYPE
325325

326326

327-
def test_command_support():
327+
def test_command_support_success():
328328
# TODO: Improve using custom config and not rely on the default one
329329
tenant = Tenant(name="tenant_name", id="0000")
330330
workspace = Workspace(
@@ -357,7 +357,7 @@ def test_command_support():
357357
assert e.value.status_code == fab_constant.ERROR_UNSUPPORTED_COMMAND
358358

359359

360-
def test_create_virtual_item_container():
360+
def test_create_virtual_item_container_success():
361361
tenant = Tenant(name="tenant_name", id="0000")
362362
workspace = Workspace(
363363
name="My workspace", id="workspace_id", parent=tenant, type="Personal"
@@ -380,7 +380,7 @@ def test_create_virtual_item_container():
380380
assert container.check_command_support(Command.FS_CD)
381381

382382

383-
def test_get_item_payloads():
383+
def test_get_item_payloads_success():
384384
tenant = Tenant(name="tenant_name", id="0000")
385385
workspace = Workspace(
386386
name="workspace_name", id="workspace_id", parent=tenant, type="Workspace"
@@ -555,27 +555,27 @@ def _make_item(item_type: str, parent=None) -> Item:
555555
class TestBuildPayload:
556556
"""Validate _build_definition includes format when provided."""
557557

558-
def test_with_format_includes_format_key(self, tmp_path):
558+
def test_with_format_includes_format_key_success(self, tmp_path):
559559
(tmp_path / "notebook.ipynb").write_text("{}")
560560
result = _build_definition(str(tmp_path), "ipynb")
561561
assert result["format"] == "ipynb"
562562
assert len(result["parts"]) == 1
563563
assert result["parts"][0]["path"] == "notebook.ipynb"
564564

565-
def test_without_format_no_format_key(self, tmp_path):
565+
def test_without_format_no_format_key_success(self, tmp_path):
566566
(tmp_path / "notebook.ipynb").write_text("{}")
567567
result = _build_definition(str(tmp_path))
568568
assert "format" not in result
569569
assert len(result["parts"]) == 1
570570

571-
def test_empty_format_no_format_key(self, tmp_path):
571+
def test_empty_format_no_format_key_success(self, tmp_path):
572572
(tmp_path / "file.json").write_text("{}")
573573
result = _build_definition(str(tmp_path), "")
574574
assert "format" not in result
575575

576576
# -- Payload construction tests -------------------------------------------
577577

578-
def test_payload_lakehouse(self):
578+
def test_payload_lakehouse_success(self):
579579
"""Any item type can have a payload constructed."""
580580
item = _make_item("Lakehouse")
581581

@@ -588,7 +588,7 @@ def _mock_build(path, resolved_format=""):
588588
assert payload["displayName"] == "item"
589589
assert payload["definition"] == {"parts": {"key": "value"}}
590590

591-
def test_payload_kql_dashboard(self):
591+
def test_payload_kql_dashboard_success(self):
592592
"""KQLDashboard (was in ImportDefinitionTypes) still works."""
593593
item = _make_item("KQLDashboard")
594594

@@ -601,7 +601,7 @@ def _mock_build(path, resolved_format=""):
601601

602602
# -- Folder-based items include folderId ----------------------------------
603603

604-
def test_payload_item_in_folder_includes_folder_id(self):
604+
def test_payload_item_in_folder_includes_folder_id_success(self):
605605
"""Items inside a folder should have folderId set."""
606606
tenant = Tenant(name="t", id="tid")
607607
ws = Workspace(name="ws", id="wsid", parent=tenant, type="Workspace")
@@ -619,14 +619,14 @@ def _mock_build(path, resolved_format=""):
619619
assert payload["folderId"] == "folder123"
620620
assert payload["definition"]["format"] == "ipynb"
621621

622-
def test_payload_item_in_workspace_folder_id_none(self):
622+
def test_payload_item_in_workspace_folder_id_none_success(self):
623623
"""Items directly under workspace should have folderId=None."""
624624
item = _make_item("Notebook")
625625
assert item.folder_id is None
626626

627627
# -- Unknown format is now validated upstream by resolve_definition_format --
628628

629-
def test_unknown_format_raises_error(self):
629+
def test_unknown_format_raises_error_failure(self):
630630
"""Unknown format raises FabricCLIError during resolution."""
631631
from fabric_cli.utils.fab_item_util import resolve_definition_format
632632

@@ -635,7 +635,7 @@ def test_unknown_format_raises_error(self):
635635
resolve_definition_format(item.item_type, "UnknownFormat")
636636

637637

638-
def test_create_folder():
638+
def test_create_folder_success():
639639
tenant = Tenant(name="tenant_name", id="0000")
640640
workspace = Workspace(
641641
name="workspace_name", id="workspace_id", parent=tenant, type="Workspace"
@@ -653,7 +653,7 @@ def test_create_folder():
653653
assert folder.check_command_support(Command.FS_LS)
654654

655655

656-
def test_create_subfolder():
656+
def test_create_subfolder_success():
657657
tenant = Tenant(name="tenant_name", id="0000")
658658
workspace = Workspace(
659659
name="workspace_name", id="workspace_id", parent=tenant, type="Workspace"

0 commit comments

Comments
 (0)