mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-07-29 21:03:02 +02:00
26 lines
582 B
Python
26 lines
582 B
Python
import pytest
|
|
|
|
from borgmatic.config import constants as module
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
'value,expected_value',
|
|
(
|
|
('3', 3),
|
|
('0', 0),
|
|
('-3', -3),
|
|
('1234', 1234),
|
|
('true', True),
|
|
('True', True),
|
|
('false', False),
|
|
('False', False),
|
|
('thing', 'thing'),
|
|
({}, {}),
|
|
({'foo': 'bar'}, {'foo': 'bar'}),
|
|
([], []),
|
|
(['foo', 'bar'], ['foo', 'bar']),
|
|
),
|
|
)
|
|
def test_coerce_scalar_converts_value(value, expected_value):
|
|
assert module.coerce_scalar(value) == expected_value
|