Fix full system test

This commit is contained in:
s3lph 2022-04-18 19:57:36 +02:00
parent 6aaf2f3baa
commit e33692f40a
3 changed files with 9 additions and 10 deletions

View file

@ -79,11 +79,12 @@ class MultiList:
if len(to_add) + len(to_subscribe) + len(to_unsubscribe) + len(to_remove) == 0: if len(to_add) + len(to_subscribe) + len(to_unsubscribe) + len(to_remove) == 0:
self._logger.info(f'No changes for {self._target}') self._logger.info(f'No changes for {self._target}')
for admin in target_admins: else:
report = AdminReport(self._target, admin.email, self._mail_from, for admin in target_admins:
admin.key.blob if admin.key is not None else None, report = AdminReport(self._target, admin.email, self._mail_from,
to_subscribe, to_unsubscribe, to_update, to_add, to_remove) admin.key.blob if admin.key is not None else None,
self._reporter.add_message(report) to_subscribe, to_unsubscribe, to_update, to_add, to_remove)
self._reporter.add_message(report)
self._logger.info(f'Finished processing: {self._target}') self._logger.info(f'Finished processing: {self._target}')
def _lists_by_name(self) -> Tuple[SchleuderList, List[SchleuderList]]: def _lists_by_name(self) -> Tuple[SchleuderList, List[SchleuderList]]:

View file

@ -38,8 +38,7 @@ class Message(abc.ABC):
return self._mime return self._mime
def _make_mime(self, content: str) -> email.mime.base.MIMEBase: def _make_mime(self, content: str) -> email.mime.base.MIMEBase:
# Encrypt to all keys, if possible. Fall back to unencrypted otherwise - PGPy does not # Encrypt to all keys, if possible. Fall back to unencrypted otherwise
# support every possible key algorithm yet, esp. it can't encrypt to ed25519 keys.
try: try:
self._mime = self._encrypt_message(content) self._mime = self._encrypt_message(content)
except Exception: except Exception:
@ -134,8 +133,7 @@ class AdminReport(Message):
removed: Set[SchleuderKey]): removed: Set[SchleuderKey]):
if len(subscribed) == 0 and len(unsubscribed) == 0 and \ if len(subscribed) == 0 and len(unsubscribed) == 0 and \
len(removed) == 0 and len(added) == 0 and len(updated) == 0: len(removed) == 0 and len(added) == 0 and len(updated) == 0:
# No changes, not creating admin report raise ValueError('No changes, not creating admin report')
return None
content = f''' content = f'''
== Admin Report for MultiSchleuder {schleuder} == == Admin Report for MultiSchleuder {schleuder} ==
''' '''

View file

@ -11,7 +11,7 @@ function gen_key {
Key-Type: EDDSA Key-Type: EDDSA
Key-Curve: ed25519 Key-Curve: ed25519
Subkey-Type: ECDH Subkey-Type: ECDH
Subkey-Curve: ed25519 Subkey-Curve: cv25519
Expire-Date: 0 Expire-Date: 0
Name-Real: Mutlischleuder Test User Name-Real: Mutlischleuder Test User
Name-Comment: TEST KEY DO NOT USE Name-Comment: TEST KEY DO NOT USE