tests(python): refactor/add/reduce tests

- We tests few things that aren't costly to tests like wrappers
- we reduce encrypted computation tests, as it's already done in cpp
  tests, while we add tests to cover supported types
This commit is contained in:
youben11
2022-04-06 15:20:02 +01:00
committed by Ayoub Benaissa
parent 0d043d0606
commit 7e535f33db
11 changed files with 454 additions and 457 deletions

View File

@@ -0,0 +1,17 @@
import re
import importlib.util
from concrete.compiler.utils import lookup_runtime_lib
def test_runtime_lib_path():
# runtime library path should be found in case the package is installed
compiler_spec = importlib.util.find_spec("concrete.compiler")
# assuming installed packages should have python and site-packages as part of the path
if compiler_spec and re.match(r".*python.*site-packages.*", compiler_spec.origin):
runtime_lib_path = lookup_runtime_lib()
assert isinstance(
runtime_lib_path, str
), f"runtime library path should be of type str, not {type(runtime_lib_path)}"
assert re.match(
r".*libConcretelangRuntime.*\.(so|dylib)$", runtime_lib_path
), f"wrong runtime library path: {runtime_lib_path}"