mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 12:15:09 -05:00
29 lines
717 B
Python
29 lines
717 B
Python
"""
|
|
Tests of `Configuration` class.
|
|
"""
|
|
|
|
import pytest
|
|
|
|
from concrete.numpy.compilation import Configuration
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"kwargs,expected_error,expected_message",
|
|
[
|
|
pytest.param(
|
|
{"enable_unsafe_features": False, "use_insecure_key_cache": True},
|
|
RuntimeError,
|
|
"Insecure key cache cannot be used without enabling unsafe features",
|
|
),
|
|
],
|
|
)
|
|
def test_configuration_bad_init(kwargs, expected_error, expected_message):
|
|
"""
|
|
Test `__init__` method of `Configuration` class with bad parameters.
|
|
"""
|
|
|
|
with pytest.raises(expected_error) as excinfo:
|
|
Configuration(**kwargs)
|
|
|
|
assert str(excinfo.value) == expected_message
|