Skip to content

Commit 439e136

Browse files
committed
Add testcase 3.7
1 parent c52bad7 commit 439e136

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/integration-test.sh

+15
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ cd ${workpath}
301301
[[ ${pkgfile} == *.tar.bz2 ]] && tar xjf ${pkgfile}
302302
cd pyarmor-$version || csih_error "Invalid pyarmor package file"
303303
tar xzf ${datafile} || csih_error "Extract data files FAILED"
304+
cp -a ../../data/package ./ || csih_error "Copy package files FAILED"
304305

305306
csih_inform "Prepare for testing"
306307
echo ""
@@ -483,6 +484,20 @@ $PYTHON pyarmor.py encrypt --with-capsule=project.zip --mode=2 \
483484
grep -q "foo.hello(2) = 7" result.log \
484485
|| csih_bug "Case 3.6 FAILED: python script returns unexpected result"
485486

487+
csih_inform "Case 3.7: import encrypted package"
488+
$PYTHON pyarmor.py encrypt --with-capsule=project.zip --in-place \
489+
--output=build_pkg package/*.py >result.log 2>&1 \
490+
|| csih_bug "Case 3.7 FAILED: return non-zero code"
491+
(cp -a package build_pkg;
492+
cd build_pkg && rm package/*.py ;
493+
cp ../startup.py ./ ;
494+
sed -i -e 's/import foo/from package import foo/g' startup.py ;
495+
$PYTHON startup.py >../result.log 2>&1 \
496+
|| csih_bug "Case 3.7 FAILED: return non-zero code"
497+
)
498+
grep -q "foo.hello(2) = 7" result.log \
499+
|| csih_bug "Case 3.7 FAILED: python script returns unexpected result"
500+
486501
#
487502
# Cross publish
488503
#

0 commit comments

Comments
 (0)