瀏覽代碼

Test for symbolic links (#42)

Test for symbolic links
tags/v0.0.1
Douglas Stebila 5 年之前
committed by GitHub
父節點
當前提交
19ebdd9ab4
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 1 個文件被更改,包括 30 次插入0 次删除
  1. +30
    -0
      test/test_no_symlinks.py

+ 30
- 0
test/test_no_symlinks.py 查看文件

@@ -0,0 +1,30 @@
"""
Checks that no implementation makes use of symbolic links.
"""

import os
import pqclean
import sys

def test_no_symlinks():
for scheme in pqclean.Scheme.all_schemes():
for implementation in scheme.implementations:
yield check_no_symlinks, scheme.name, implementation.name


def check_no_symlinks(scheme_name, implementation_name):
implementation = pqclean.Implementation.by_name(
scheme_name, implementation_name)
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()

Loading…
取消
儲存