Skip to content

Commit e73055d

Browse files
committed
update test case
1 parent b7cc050 commit e73055d

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

test_utils.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -640,33 +640,33 @@ def test_layer_mode():
640640
assert set(zf.namelist()) == namelist, zf.namelist()
641641

642642

643-
# def test_chmod():
644-
# if os.name != "nt":
645-
# # posix only
646-
# # test --chmod
647-
# _clean_paths(root=False)
648-
# app_path = create_app(unzip="*", pip_args=["six"], lazy_install=True)
649-
# subprocess.Popen([sys.executable, str(app_path), "--activate-zipapps"]).wait()
650-
# temp = oct(app_path.stat().st_mode)[-3:]
651-
# assert temp != "777", temp
652-
# for _path in Path("zipapps_cache/app").rglob("*"):
653-
# if _path.name == "six.py":
654-
# temp = oct(_path.stat().st_mode)[-3:]
655-
# assert temp != "777", temp
656-
# break
657-
658-
# _clean_paths(root=False)
659-
# app_path = create_app(
660-
# unzip="*", pip_args=["six"], lazy_install=True, chmod="777"
661-
# )
662-
# subprocess.Popen([sys.executable, str(app_path), "--activate-zipapps"]).wait()
663-
# temp = oct(app_path.stat().st_mode)[-3:]
664-
# assert temp == "777", temp
665-
# for _path in Path("zipapps_cache/app").rglob("*"):
666-
# if _path.name == "six.py":
667-
# temp = oct(_path.stat().st_mode)[-3:]
668-
# assert temp == "777", temp
669-
# break
643+
def test_chmod():
644+
if os.name != "nt":
645+
# posix only
646+
# test --chmod
647+
_clean_paths(root=False)
648+
app_path = create_app(unzip="*", pip_args=["six"], lazy_install=True)
649+
subprocess.Popen([sys.executable, str(app_path), "--activate-zipapps"]).wait()
650+
temp = oct(app_path.stat().st_mode)[-3:]
651+
assert temp != "777", temp
652+
for _path in Path("zipapps_cache/app").rglob("*"):
653+
if _path.name == "six.py":
654+
temp = oct(_path.stat().st_mode)[-3:]
655+
assert temp != "777", temp
656+
break
657+
658+
_clean_paths(root=False)
659+
app_path = create_app(
660+
unzip="*", pip_args=["six"], lazy_install=True, chmod="777"
661+
)
662+
subprocess.Popen([sys.executable, str(app_path), "--activate-zipapps"]).wait()
663+
temp = oct(app_path.stat().st_mode)[-3:]
664+
assert temp == "777", temp
665+
for _path in Path("zipapps_cache/app").rglob("*"):
666+
if _path.name == "six.py":
667+
temp = oct(_path.stat().st_mode)[-3:]
668+
assert temp == "777", temp
669+
break
670670

671671

672672
def test_delete_useless():

0 commit comments

Comments
 (0)