pqc/test/test_license.py
Thom Wiggers 75be658074
Clean up tests
Modify the tests to no longer construct the classes multiple times and
to have them make use of the new helpers.make() function.
2019-03-04 17:02:46 +01:00

29 lines
664 B
Python

"""
Checks that a LICENSE or LICENSE.txt file is present for every
implementation of the specified scheme.
"""
import os
import pqclean
def test_license():
for scheme in pqclean.Scheme.all_schemes():
for implementation in scheme.implementations:
yield check_license, implementation
def check_license(implementation):
p1 = os.path.join(implementation.path(), 'LICENSE')
p2 = os.path.join(implementation.path(), 'LICENSE.txt')
assert(os.path.isfile(p1) or os.path.isfile(p2))
if __name__ == '__main__':
try:
import nose2
nose2.main()
except ImportError:
import nose
nose.runmodule()