add test_insert_triple_t_multiple_metadata()

This commit is contained in:
Felix C. Stegerman 2021-07-03 21:20:18 +02:00
parent 051905620d
commit 73f28a611c
No known key found for this signature in database
GPG Key ID: B218FF2C27FC6CC6
9 changed files with 137 additions and 0 deletions

View File

@ -820,6 +820,12 @@ include tests/triple-t-2/build/org.piwigo.android/app/src/main/play/release-note
include tests/triple-t-2/build/org.piwigo.android/build.gradle
include tests/triple-t-2/build/org.piwigo.android/settings.gradle
include tests/triple-t-2/metadata/org.piwigo.android.yml
include tests/triple-t-multiple/build/ch.admin.bag.covidcertificate.verifier/verifier/src/main/play/listings/en-US/title.txt
include tests/triple-t-multiple/build/ch.admin.bag.covidcertificate.verifier/wallet/src/main/play/listings/en-US/title.txt
include tests/triple-t-multiple/build/ch.admin.bag.covidcertificate.wallet/verifier/src/main/play/listings/en-US/title.txt
include tests/triple-t-multiple/build/ch.admin.bag.covidcertificate.wallet/wallet/src/main/play/listings/en-US/title.txt
include tests/triple-t-multiple/metadata/ch.admin.bag.covidcertificate.verifier.yml
include tests/triple-t-multiple/metadata/ch.admin.bag.covidcertificate.wallet.yml
include tests/update.TestCase
include tests/urzip.apk
include tests/urzip-badcert.apk

1
tests/triple-t-multiple/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
!build/

View File

@ -0,0 +1,50 @@
AntiFeatures:
- Tracking
Categories:
- Sports & Health
License: MPL-2.0
AuthorName: Swiss Admin
AuthorWebSite: https://www.bit.admin.ch
SourceCode: https://github.com/admin-ch/CovidCertificate-App-Android
IssueTracker: https://github.com/admin-ch/CovidCertificate-App-Android/issues
Changelog: https://github.com/admin-ch/CovidCertificate-App-Android/releases
AutoName: Covid Cert
RepoType: git
Repo: https://github.com/admin-ch/CovidCertificate-App-Android
Binaries: https://github.com/admin-ch/CovidCertificate-App-Android/releases/download/v%v-%c-verifier/verifier-prod-%v-%c-signed.apk
Builds:
- versionName: 1.2.0
versionCode: 1200
commit: v1.2.0-1200-verifier
subdir: verifier
submodules: true
gradle:
- prod
rm:
- sdk/sdk/testKeystore
- wallet/testKeystore
- verifier/testKeystore
prebuild: printf '\nbuildTimestamp=%s\n' "$(curl -sL https://github.com/admin-ch/CovidCertificate-App-Android/releases/download/v$$VERSION$$-$$VERCODE$$-verifier/verifier-prod-$$VERSION$$-$$VERCODE$$-buildtimestamp.txt
| tr -cd '0-9')" >> gradle.properties
- versionName: 2.0.0
versionCode: 2000
commit: 5a871eabf1fce16b84e4c7b97c94fd3f2a37e910
subdir: verifier
submodules: true
gradle:
- prod
rm:
- sdk/sdk/testKeystore
- wallet/testKeystore
- verifier/testKeystore
prebuild: printf '\nbuildTimestamp=%s\n' "$(curl -sL https://github.com/admin-ch/CovidCertificate-App-Android/releases/download/v$$VERSION$$-$$VERCODE$$-verifier/verifier-prod-$$VERSION$$-$$VERCODE$$-buildtimestamp.txt
| tr -cd '0-9')" >> gradle.properties
AutoUpdateMode: Version
UpdateCheckMode: Tags ^v[\d.]+-\d+-verifier$
CurrentVersion: 2.0.0
CurrentVersionCode: 2000

View File

@ -0,0 +1,50 @@
AntiFeatures:
- Tracking
Categories:
- Sports & Health
License: MPL-2.0
AuthorName: Swiss Admin
AuthorWebSite: https://www.bit.admin.ch
SourceCode: https://github.com/admin-ch/CovidCertificate-App-Android
IssueTracker: https://github.com/admin-ch/CovidCertificate-App-Android/issues
Changelog: https://github.com/admin-ch/CovidCertificate-App-Android/releases
AutoName: Covid Cert
RepoType: git
Repo: https://github.com/admin-ch/CovidCertificate-App-Android
Binaries: https://github.com/admin-ch/CovidCertificate-App-Android/releases/download/v%v-%c-wallet/wallet-prod-%v-%c-signed.apk
Builds:
- versionName: 1.2.0
versionCode: 1200
commit: v1.2.0-1200-wallet
subdir: wallet
submodules: true
gradle:
- prod
rm:
- sdk/sdk/testKeystore
- wallet/testKeystore
- verifier/testKeystore
prebuild: printf '\nbuildTimestamp=%s\n' "$(curl -sL https://github.com/admin-ch/CovidCertificate-App-Android/releases/download/v$$VERSION$$-$$VERCODE$$-wallet/wallet-prod-$$VERSION$$-$$VERCODE$$-buildtimestamp.txt
| tr -cd '0-9')" >> gradle.properties
- versionName: 2.0.0
versionCode: 2000
commit: 5a871eabf1fce16b84e4c7b97c94fd3f2a37e910
subdir: wallet
submodules: true
gradle:
- prod
rm:
- sdk/sdk/testKeystore
- wallet/testKeystore
- verifier/testKeystore
prebuild: printf '\nbuildTimestamp=%s\n' "$(curl -sL https://github.com/admin-ch/CovidCertificate-App-Android/releases/download/v$$VERSION$$-$$VERCODE$$-wallet/wallet-prod-$$VERSION$$-$$VERCODE$$-buildtimestamp.txt
| tr -cd '0-9')" >> gradle.properties
AutoUpdateMode: Version
UpdateCheckMode: Tags ^v[\d.]+-\d+-wallet$
CurrentVersion: 2.0.0
CurrentVersionCode: 2000

View File

@ -409,6 +409,32 @@ class UpdateTest(unittest.TestCase):
self.assertFalse(os.path.exists(os.path.join('de-DE', 'phoneScreenshots', '01_Login.jpg')))
self.assertFalse(os.path.exists(os.path.join('de-DE', 'sevenInchScreenshots', '01_Login.png')))
def test_insert_triple_t_multiple_metadata(self):
namespace = 'ch.admin.bag.covidcertificate.'
packages = ('verifier', 'wallet')
names = dict(verifier='COVID Certificate Check', wallet='COVID Certificate')
tmptestsdir = tempfile.mkdtemp(
prefix=inspect.currentframe().f_code.co_name, dir=self.tmpdir
)
os.rmdir(tmptestsdir)
shutil.copytree(os.path.join(self.basedir, 'triple-t-multiple'), tmptestsdir)
os.chdir(tmptestsdir)
for p in packages:
packageName = namespace + p
config = dict()
fdroidserver.common.fill_config_defaults(config)
fdroidserver.common.config = config
fdroidserver.update.config = config
fdroidserver.update.options = fdroidserver.common.options
apps = fdroidserver.metadata.read_metadata()
self.assertTrue(packageName in apps)
fdroidserver.update.copy_triple_t_store_metadata(apps)
app = apps[packageName]
self.assertEqual(app['localized']['en-US']['name'], names[p])
def javagetsig(self, apkfile):
getsig_dir = 'getsig'
if not os.path.exists(os.path.join(getsig_dir, "getsig.class")):