mirror of
https://github.com/MinaSaad1/pbi-cli
synced 2026-04-21 13:37:19 +00:00
fix: apply ruff formatting to platform module and tests
This commit is contained in:
parent
dd4b0992a3
commit
e19981d98c
2 changed files with 5 additions and 23 deletions
|
|
@ -73,18 +73,12 @@ def _workspace_candidates() -> list[Path]:
|
|||
local_app_data = os.environ.get("LOCALAPPDATA", "")
|
||||
if local_app_data:
|
||||
dirs.append(
|
||||
Path(local_app_data)
|
||||
/ "Microsoft"
|
||||
/ "Power BI Desktop"
|
||||
/ "AnalysisServicesWorkspaces"
|
||||
Path(local_app_data) / "Microsoft" / "Power BI Desktop" / "AnalysisServicesWorkspaces"
|
||||
)
|
||||
|
||||
user_profile = Path.home()
|
||||
dirs.append(
|
||||
user_profile
|
||||
/ "Microsoft"
|
||||
/ "Power BI Desktop Store App"
|
||||
/ "AnalysisServicesWorkspaces"
|
||||
user_profile / "Microsoft" / "Power BI Desktop Store App" / "AnalysisServicesWorkspaces"
|
||||
)
|
||||
|
||||
return dirs
|
||||
|
|
@ -103,9 +97,7 @@ def discover_pbi_port() -> int | None:
|
|||
for workspaces_dir in _workspace_candidates():
|
||||
if not workspaces_dir.exists():
|
||||
continue
|
||||
port_files.extend(
|
||||
workspaces_dir.glob("*/Data/msmdsrv.port.txt")
|
||||
)
|
||||
port_files.extend(workspaces_dir.glob("*/Data/msmdsrv.port.txt"))
|
||||
|
||||
if not port_files:
|
||||
return None
|
||||
|
|
|
|||
|
|
@ -195,12 +195,7 @@ def test_discover_pbi_port_empty_workspace_dir(
|
|||
|
||||
def test_discover_pbi_port_store_version(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""Reads port from Microsoft Store installation path (UTF-16 LE)."""
|
||||
store_ws = (
|
||||
tmp_path
|
||||
/ "Microsoft"
|
||||
/ "Power BI Desktop Store App"
|
||||
/ "AnalysisServicesWorkspaces"
|
||||
)
|
||||
store_ws = tmp_path / "Microsoft" / "Power BI Desktop Store App" / "AnalysisServicesWorkspaces"
|
||||
data_dir = store_ws / "AnalysisServicesWorkspace_xyz" / "Data"
|
||||
data_dir.mkdir(parents=True)
|
||||
# Store version writes UTF-16 LE without BOM
|
||||
|
|
@ -230,12 +225,7 @@ def test_discover_pbi_port_store_preferred_over_stale_msi(
|
|||
|
||||
# Newer Store workspace
|
||||
home = tmp_path / "home"
|
||||
store_ws = (
|
||||
home
|
||||
/ "Microsoft"
|
||||
/ "Power BI Desktop Store App"
|
||||
/ "AnalysisServicesWorkspaces"
|
||||
)
|
||||
store_ws = home / "Microsoft" / "Power BI Desktop Store App" / "AnalysisServicesWorkspaces"
|
||||
store_data = store_ws / "AnalysisServicesWorkspace_new" / "Data"
|
||||
store_data.mkdir(parents=True)
|
||||
(store_data / "msmdsrv.port.txt").write_text("22222", encoding="utf-8")
|
||||
|
|
|
|||
Loading…
Reference in a new issue