Skip to content

Commit e8b5a05

Browse files
committed
add unit tests for checking invalid manifest info
1 parent 69a3e3d commit e8b5a05

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/test_bundle.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2425,3 +2425,26 @@ def test_make_manifest_bundle():
24252425
bundle_json = json.loads(tar.extractfile("manifest.json").read().decode("utf-8"))
24262426
assert manifest["metadata"] == bundle_json["metadata"]
24272427
assert manifest["files"].keys() == bundle_json["files"].keys()
2428+
2429+
2430+
def test_make_bundle_empty_manifest():
2431+
manifest = {}
2432+
with pytest.raises(TypeError):
2433+
make_manifest_bundle(manifest)
2434+
2435+
2436+
def test_make_bundle_missing_file_in_manifest():
2437+
manifest = {
2438+
"version": 1,
2439+
"locale": "en_US.UTF-8",
2440+
"metadata": {"appmode": "python-shiny", "entrypoint": "app5"},
2441+
"python": {
2442+
"version": "3.8.12",
2443+
"package_manager": {"name": "pip", "version": "23.0.1", "package_file": "requirements.txt"},
2444+
},
2445+
"files": {
2446+
"requirements1.txt": {"checksum": "c82f1a9894e5510b2f0c16fa63aaa004"},
2447+
},
2448+
}
2449+
with pytest.raises(TypeError):
2450+
make_manifest_bundle(manifest)

0 commit comments

Comments
 (0)