Skip to content

Commit 961d95e

Browse files
Fix tests
Signed-off-by: Jean-Christophe Morin <[email protected]>
1 parent 5b76ca7 commit 961d95e

File tree

1 file changed

+31
-12
lines changed

1 file changed

+31
-12
lines changed

tests/plugins/test_pyside6.py

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import sys
23
import typing
34
import pathlib
@@ -203,18 +204,36 @@ def test_cleanup_noop(package, tmp_path: pathlib.Path):
203204

204205

205206
@pytest.mark.parametrize(
206-
"package",
207+
"package,expectedPaths",
207208
[
208-
fakePackage("pyside6"),
209-
fakePackage("pyside6_essentials"),
210-
fakePackage("PySiDe6-AddoNs"),
209+
[fakePackage("pyside6"), ["shiboken6", "shiboken6_generator"]],
210+
[
211+
fakePackage("pyside6_essentials"),
212+
[
213+
"shiboken6",
214+
"shiboken6_generator",
215+
os.path.join("PySide6", "__init__.py"),
216+
],
217+
],
218+
[
219+
fakePackage("PySiDe6-AddoNs"),
220+
[
221+
"shiboken6",
222+
"shiboken6_generator",
223+
os.path.join("PySide6", "__init__.py"),
224+
],
225+
],
211226
],
212227
)
213-
def test_cleanup(package, tmp_path: pathlib.Path):
214-
(tmp_path / "python" / "shiboken6").mkdir(parents=True)
215-
(tmp_path / "python" / "shiboken6_generator").mkdir(parents=True)
216-
217-
rez_pip.plugins.getHook().cleanup(dist=package, path=tmp_path)
218-
219-
assert not (tmp_path / "python" / "shiboken6").exists()
220-
assert not (tmp_path / "python" / "shiboken6_generator").exists()
228+
def test_cleanup(package, expectedPaths: typing.List[str], tmp_path: pathlib.Path):
229+
actions = rez_pip.plugins.getHook().cleanup(dist=package, path=tmp_path)
230+
231+
expectedActions = []
232+
for path in expectedPaths:
233+
expectedActions.append(
234+
rez_pip.plugins.CleanupAction(
235+
"remove",
236+
str(tmp_path / "python" / path),
237+
)
238+
)
239+
assert actions == [[], expectedActions]

0 commit comments

Comments
 (0)