use subclass hack for better ZIP cloning

See https://bugs.python.org/issue43547 for more info on the details.

thanks to @obfusk for the technique
This commit is contained in:
Felix C. Stegerman 2021-04-12 19:30:45 +02:00
parent 3d6345a595
commit 67a0f3ae5b
No known key found for this signature in database
GPG key ID: B218FF2C27FC6CC6
2 changed files with 31 additions and 2 deletions

View file

@ -1754,6 +1754,13 @@ class CommonTest(unittest.TestCase):
fdroidserver.common.read_pkg_args(appid_versionCode_pairs, allow_vercodes)
)
def test_apk_strip_v1_signatures(self):
testdir = tempfile.mkdtemp(prefix=inspect.currentframe().f_code.co_name, dir=self.tmpdir)
before = os.path.join(self.basedir, 'no_targetsdk_minsdk1_unsigned.apk')
after = os.path.join(testdir, 'after.apk')
shutil.copy(before, after)
fdroidserver.common.apk_strip_v1_signatures(after, strip_manifest=False)
if __name__ == "__main__":
os.chdir(os.path.dirname(__file__))