Move index signing methods into signindex.py

This commit is contained in:
Torsten Grote 2017-03-29 12:11:40 -03:00
parent 8f96c9da3d
commit 9f765ed6f7
No known key found for this signature in database
GPG key ID: 3E5F77D92CF891FF
4 changed files with 55 additions and 47 deletions

View file

@ -12,6 +12,8 @@ import tempfile
import unittest
from zipfile import ZipFile
import fdroidserver.signindex
localmodule = os.path.realpath(
os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), '..'))
print('localmodule: ' + localmodule)
@ -163,6 +165,7 @@ class CommonTest(unittest.TestCase):
config = fdroidserver.common.read_config(fdroidserver.common.options)
config['jarsigner'] = fdroidserver.common.find_sdk_tools_cmd('jarsigner')
fdroidserver.common.config = config
fdroidserver.signindex.config = config
basedir = os.path.dirname(__file__)
tmpdir = os.path.join(basedir, '..', '.testfiles')
@ -174,7 +177,7 @@ class CommonTest(unittest.TestCase):
sourcefile = os.path.join(sourcedir, f)
testfile = os.path.join(testsdir, f)
shutil.copy(sourcefile, testsdir)
fdroidserver.common.signjar(testfile)
fdroidserver.signindex.sign_jar(testfile)
# these should be resigned, and therefore different
self.assertNotEqual(open(sourcefile, 'rb').read(), open(testfile, 'rb').read())