Skip to content

Commit 8774a3d

Browse files
committed
ensure posix paths in test cases
1 parent e9793db commit 8774a3d

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

tests/test_bundle.py

+8-18
Original file line numberDiff line numberDiff line change
@@ -1126,9 +1126,6 @@ def test_create_voila_manifest_multi_notebook(path, entrypoint):
11261126
source="file",
11271127
)
11281128

1129-
bqplot_path = os.path.join("bqplot", "bqplot.ipynb")
1130-
dashboard_path = os.path.join("dashboard", "dashboard.ipynb")
1131-
11321129
if sys.platform == "win32":
11331130
bqplot_hash = "ddb4070466d3c45b2f233dd39906ddf6"
11341131
dashboard_hash = "b2d7dc369ac602c7d7a703b6eb868562"
@@ -1146,8 +1143,8 @@ def test_create_voila_manifest_multi_notebook(path, entrypoint):
11461143
},
11471144
"files": {
11481145
"requirements.txt": {"checksum": "9cce1aac313043abd5690f67f84338ed"},
1149-
bqplot_path: {"checksum": bqplot_hash},
1150-
dashboard_path: {"checksum": dashboard_hash},
1146+
"bqplot/bqplot.ipynb": {"checksum": bqplot_hash},
1147+
"dashboard/dashboard.ipynb": {"checksum": dashboard_hash},
11511148
},
11521149
}
11531150
manifest = Manifest()
@@ -1182,7 +1179,7 @@ def test_create_voila_manifest_multi_notebook(path, entrypoint):
11821179
image=None,
11831180
multi_notebook=True,
11841181
)
1185-
assert ans == json.loads(manifest.flattened_copy.json)
1182+
assert json.loads(manifest.flattened_copy.json) == ans
11861183

11871184

11881185
@pytest.mark.parametrize(
@@ -1345,9 +1342,6 @@ def test_make_voila_bundle_multi_notebook(
13451342
source="file",
13461343
)
13471344

1348-
bqplot_path = os.path.join("bqplot", "bqplot.ipynb")
1349-
dashboard_path = os.path.join("dashboard", "dashboard.ipynb")
1350-
13511345
if sys.platform == "win32":
13521346
bqplot_hash = "ddb4070466d3c45b2f233dd39906ddf6"
13531347
dashboard_hash = "b2d7dc369ac602c7d7a703b6eb868562"
@@ -1365,8 +1359,8 @@ def test_make_voila_bundle_multi_notebook(
13651359
},
13661360
"files": {
13671361
"requirements.txt": {"checksum": "9395f3162b7779c57c86b187fa441d96"},
1368-
bqplot_path: {"checksum": bqplot_hash},
1369-
dashboard_path: {"checksum": dashboard_hash},
1362+
"bqplot/bqplot.ipynb": {"checksum": bqplot_hash},
1363+
"dashboard/dashboard.ipynb": {"checksum": dashboard_hash},
13701364
},
13711365
}
13721366
if (path, entrypoint) in (
@@ -1407,7 +1401,7 @@ def test_make_voila_bundle_multi_notebook(
14071401
]
14081402
reqs = tar.extractfile("requirements.txt").read()
14091403
assert reqs == b"bqplot"
1410-
assert ans == json.loads(tar.extractfile("manifest.json").read().decode("utf-8"))
1404+
assert json.loads(tar.extractfile("manifest.json").read().decode("utf-8")) == ans
14111405

14121406

14131407
@pytest.mark.parametrize(
@@ -1575,8 +1569,6 @@ def test_create_html_manifest():
15751569
image=None,
15761570
)
15771571

1578-
test_folder_path = os.path.join("test_folder1", "testfoldertext1.txt")
1579-
15801572
if sys.platform == "win32":
15811573
index_hash = "0c3d8c84223089949954d069f2eef7e9"
15821574
txt_hash = "e6a96602853b20607831eec27dbb6cf0"
@@ -1603,7 +1595,7 @@ def test_create_html_manifest():
16031595
"files": {
16041596
"index.html": {"checksum": index_hash},
16051597
"test1.txt": {"checksum": txt_hash},
1606-
test_folder_path: {"checksum": folder_txt_hash},
1598+
"test_folder1/testfoldertext1.txt": {"checksum": folder_txt_hash},
16071599
},
16081600
}
16091601

@@ -1712,8 +1704,6 @@ def test_create_html_manifest():
17121704

17131705

17141706
def test_make_html_bundle():
1715-
folder_path = os.path.join("test_folder1", "testfoldertext1.txt")
1716-
17171707
if sys.platform == "win32":
17181708
index_hash = "0c3d8c84223089949954d069f2eef7e9"
17191709
txt_hash = "e6a96602853b20607831eec27dbb6cf0"
@@ -1747,7 +1737,7 @@ def test_make_html_bundle():
17471737
"files": {
17481738
"index.html": {"checksum": index_hash},
17491739
"test1.txt": {"checksum": txt_hash},
1750-
folder_path: {"checksum": folder_txt_hash},
1740+
"test_folder1/testfoldertext1.txt": {"checksum": folder_txt_hash},
17511741
},
17521742
}
17531743
with make_html_bundle(

0 commit comments

Comments
 (0)