From 493d77d89bd714f22d4ec1ff1d4bb10478679352 Mon Sep 17 00:00:00 2001 From: Joost Rijneveld Date: Mon, 8 Apr 2019 11:14:45 +0200 Subject: [PATCH] Ensure tests do not break without schemes --- test/pqclean.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/pqclean.py b/test/pqclean.py index f3384dbe..2add38b8 100644 --- a/test/pqclean.py +++ b/test/pqclean.py @@ -40,14 +40,15 @@ class Scheme: def all_schemes_of_type(type: str) -> list: schemes = [] p = os.path.join('..', 'crypto_' + type) - for d in os.listdir(p): - if os.path.isdir(os.path.join(p, d)): - if type == 'kem': - schemes.append(KEM(d)) - elif type == 'sign': - schemes.append(Signature(d)) - else: - assert('Unknown type') + if os.path.isdir(p): + for d in os.listdir(p): + if os.path.isdir(os.path.join(p, d)): + if type == 'kem': + schemes.append(KEM(d)) + elif type == 'sign': + schemes.append(Signature(d)) + else: + assert('Unknown type') return schemes def metadata(self):