@@ -449,7 +449,7 @@ def hello(arg="first"):
449
449
users = [ "bob", "time", 3]
450
450
return "%s,%s,%s" % (name, arg, users[0])
451
451
EOF
452
- $PYTHON pyarmor.py encrypt --mode=3 -C project.zip -O test_const co_consts.py > result.log 2>&1
452
+ $PYTHON pyarmor.py encrypt --mode=5 -C project.zip -O test_const co_consts.py > result.log 2>&1
453
453
if [[ -f test_const/co_consts.pyc ]] ; then
454
454
cd test_const
455
455
grep -q " \(Module comment\|Hello\|Function comment\|jondy\|bob\|time\)" co_consts.pyc \
@@ -468,6 +468,26 @@ else
468
468
csih_bug " Case 2.6 FAILED: no test_consts/co_consts.pyc found"
469
469
fi
470
470
471
+ csih_inform " Case 2.7: verify mode 6 works"
472
+ $PYTHON pyarmor.py encrypt --mode=6 -C project.zip -O test_mode6 co_consts.py > result.log 2>&1
473
+ if [[ -f test_mode6/co_consts.pyc ]] ; then
474
+ cd test_mode6
475
+ grep -q " \(Module comment\|Hello\|Function comment\|jondy\|bob\|time\)" co_consts.pyc \
476
+ && csih_bug " Case 2.7 FAILED: co_consts still in clear text"
477
+ cat << EOF > main.py
478
+ import pyimcore
479
+ import sys
480
+ import co_consts
481
+ sys.stdout.write("%s:%s:%s" % (co_consts.title, co_consts.__doc__, co_consts.hello("second")))
482
+ EOF
483
+ $PYTHON main.py > result.log 2>&1 || csih_bug " Case 2.7 FAILED: run script return non-zero code"
484
+ grep -q " Hello:Module comment:jondy,second,bob" result.log \
485
+ || csih_bug " Case 2.7 FAILED: python script returns unexpected result"
486
+ cd ..
487
+ else
488
+ csih_bug " Case 2.7 FAILED: no test_mode6/co_consts.pyc found"
489
+ fi
490
+
471
491
#
472
492
# Import encrypted module and run encrypted scripts
473
493
#
0 commit comments