Files
concrete/compiler/tests/python/test_utils.py
youben11 7e535f33db 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
2022-04-08 19:05:06 +01:00

18 lines
793 B
Python

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}"