1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-23 07:59:01 +00:00
pqcrypto/test/test_no_symlinks.py
Thom Wiggers 65d43df241
Change permit test into a decorator
This way we can properly raise skiptest
2019-04-18 11:26:28 +02:00

31 lines
717 B
Python

"""
Checks that no implementation makes use of symbolic links.
"""
import os
import pqclean
import helpers
def test_no_symlinks():
for scheme in pqclean.Scheme.all_schemes():
for implementation in scheme.implementations:
yield check_no_symlinks, implementation
@helpers.filtered_test
def check_no_symlinks(implementation):
for file in os.listdir(implementation.path()):
fpath = os.path.join(implementation.path(), file)
if os.path.islink(fpath):
raise AssertionError("{} is a symbolic link!".format(fpath))
if __name__ == '__main__':
try:
import nose2
nose2.main()
except ImportError:
import nose
nose.runmodule()