Skip to content

Commit

Permalink
Add tests fuzzing the reference syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
akaIDIOT committed Jan 21, 2019
1 parent c1e5b68 commit 0ed336b
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tests/test_references.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
import pytest

from confidence import Configuration, ConfigurationError, ConfiguredReferenceError
from confidence import Configuration, ConfigurationError, ConfiguredReferenceError, NotConfigured


def test_reference_syntax():
config = Configuration({
'key1': '$(reference)',
'key2': '${reference)',
'key3': '${}',
'key4': '$ {reference}',
'key5': '#{reference}',
'key_with_space ': 'value',
'key6': '${key_with_space }',
})

assert config.reference is NotConfigured
assert '$' in config.key1
assert '$' in config.key2
assert '$' in config.key3
assert '$' in config.key4
assert '#' in config.key5
assert config.key6 == 'value'


def test_value_types():
Expand Down

0 comments on commit 0ed336b

Please sign in to comment.