You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
795 B

  1. """
  2. Checks that a LICENSE or LICENSE.txt file is present for every
  3. implementation of the specified scheme.
  4. """
  5. import os
  6. import pqclean
  7. def test_license():
  8. for scheme in pqclean.Scheme.all_schemes():
  9. for implementation in scheme.implementations:
  10. yield check_license, scheme.name, implementation.name
  11. def check_license(scheme_name, implementation_name):
  12. implementation = pqclean.Implementation.by_name(
  13. scheme_name, implementation_name)
  14. p1 = os.path.join(implementation.path(), 'LICENSE')
  15. p2 = os.path.join(implementation.path(), 'LICENSE.txt')
  16. assert(os.path.isfile(p1) or os.path.isfile(p2))
  17. if __name__ == '__main__':
  18. try:
  19. import nose2
  20. nose2.main()
  21. except ImportError:
  22. import nose
  23. nose.runmodule()