Skip to content

Commit

Permalink
Add additional date-centric key-type-reject-test
Browse files Browse the repository at this point in the history
Co-authored-by: bartbroere <2715782+bartbroere@users.noreply.github.com>
Co-authored-by: drxzcl <1767182+drxzcl@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 1, 2019
1 parent 504c6d7 commit dab8860
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from datetime import date

import pytest

from confidence.utils import _Conflict, _merge, _split_keys
Expand Down Expand Up @@ -148,3 +150,17 @@ def test_split_key_types():
assert not _split_keys(subject)

assert '1234' in str(e.value)
assert 'int' in str(e.value)

subject = {
'ns.2019-04-01.key': 42,
'ns': {
date(2019, 4, 1): {'key2': 43}
}
}

with pytest.raises(ValueError) as e:
assert not _split_keys(subject)

assert '2019-04-01' in str(e.value)
assert 'datetime.date' in str(e.value)

0 comments on commit dab8860

Please sign in to comment.