Compare commits
No commits in common. "bfcdf0f020c3ed21b12e73c3db52457803362e47" and "2c0dcb6e9e19907ea1e8bc5f221e750f0f35dd6f" have entirely different histories.
bfcdf0f020
...
2c0dcb6e9e
|
@ -215,16 +215,12 @@ def parse_block(key, seq):
|
|||
if op == '+=':
|
||||
if isinstance(ret[k], str):
|
||||
assign = [ret[k]]
|
||||
elif ret[k] is True:
|
||||
assign = []
|
||||
else:
|
||||
assign = ret[k]
|
||||
if isinstance(value, str):
|
||||
assign.append(value)
|
||||
else:
|
||||
assign.extend(value)
|
||||
if isinstance(assign, list) and len(assign) == 1:
|
||||
assign = assign[0]
|
||||
else:
|
||||
assign = value
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
# pylint: disable=missing-module-docstring,invalid-name
|
||||
version = '0.1.2'
|
||||
version = '0.1.1'
|
||||
|
|
|
@ -65,23 +65,3 @@ def test_ovewrite_nonexistent():
|
|||
'Keys can only be updated if they exist.'
|
||||
with pytest.raises(ParseError):
|
||||
loads_xbc('a := 1')
|
||||
|
||||
def test_append_key():
|
||||
'Append an item to a key.'
|
||||
assert loads_xbc('a; a += 1') == {'a': '1'}
|
||||
|
||||
def test_append_single():
|
||||
'Append an item to a single-item value.'
|
||||
assert loads_xbc('a = 1; a += 2') == {'a': ['1', '2']}
|
||||
|
||||
def test_append_single2():
|
||||
'Append multiple items to a single-item value.'
|
||||
assert loads_xbc('a = 1; a += 2, 3') == {'a': ['1', '2', '3']}
|
||||
|
||||
def test_append_multi():
|
||||
'Append an item to an array value'
|
||||
assert loads_xbc('a = 1, 2; a += 3') == {'a': ['1', '2', '3']}
|
||||
|
||||
def test_append_multi2():
|
||||
'Append multiple items to an array value.'
|
||||
assert loads_xbc('a = 1, 2; a += 3, 4') == {'a': ['1', '2', '3', '4']}
|
||||
|
|
Loading…
Reference in New Issue