Skip to content

Commit eb340e8

Browse files
committed
feat(tests): added check for .nupkg content
1 parent 1298500 commit eb340e8

2 files changed

Lines changed: 45 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath"
3-
version = "2.1.12"
3+
version = "2.1.13"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

tests/cli/test_pack.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,3 +493,47 @@ def test_dependencies_version_formats(
493493
assert "projectId" in operate_data
494494
assert operate_data["targetRuntime"] == "python"
495495
assert operate_data["targetFramework"] == "Portable"
496+
497+
def test_nupkg_contains_all_necessary_files(
498+
self,
499+
runner: CliRunner,
500+
temp_dir: str,
501+
project_details: ProjectDetails,
502+
uipath_json: UiPathJson,
503+
) -> None:
504+
with runner.isolated_filesystem(temp_dir=temp_dir):
505+
with open("uipath.json", "w") as f:
506+
f.write(uipath_json.to_json())
507+
with open("pyproject.toml", "w") as f:
508+
f.write(project_details.to_toml())
509+
with open("uv.lock", "w") as f:
510+
f.write("# uv.lock content")
511+
for entry in uipath_json.entry_points:
512+
with open(f"{entry.file_path}.py", "w") as f:
513+
f.write("# agent content")
514+
515+
result = runner.invoke(pack, ["./"])
516+
assert result.exit_code == 0
517+
518+
nupkg_path = (
519+
f".uipath/{project_details.name}.{project_details.version}.nupkg"
520+
)
521+
assert os.path.exists(nupkg_path)
522+
523+
# List of expected files in the package
524+
expected_files = [
525+
"content/uipath.json",
526+
"content/pyproject.toml",
527+
"content/operate.json",
528+
"content/entry-points.json",
529+
"content/bindings_v2.json",
530+
"content/uv.lock",
531+
]
532+
533+
for entry in uipath_json.entry_points:
534+
expected_files.append(f"content/{entry.file_path}.py")
535+
536+
with zipfile.ZipFile(nupkg_path, "r") as z:
537+
actual_files = set(z.namelist())
538+
for expected in expected_files:
539+
assert expected in actual_files, f"Missing {expected} in nupkg"

0 commit comments

Comments
 (0)