[#1928] change to plus for append/insert
This commit is contained in:
parent
ed58502246
commit
186bc09b4d
2 changed files with 12 additions and 9 deletions
|
|
@ -553,9 +553,9 @@ class TestBuilding(CommandTest):
|
|||
"Obj/test1[5] =", "Obj has no attribute 'test1[5]'.")
|
||||
# Append
|
||||
self.call(building.CmdSetAttribute(),
|
||||
"Obj/test1[@] = 42", "Modified attribute Obj/test1 = [2, 42]")
|
||||
"Obj/test1[+] = 42", "Modified attribute Obj/test1 = [2, 42]")
|
||||
self.call(building.CmdSetAttribute(),
|
||||
"Obj/test1[@0] = -1", "Modified attribute Obj/test1 = [-1, 2, 42]")
|
||||
"Obj/test1[+0] = -1", "Modified attribute Obj/test1 = [-1, 2, 42]")
|
||||
|
||||
# dict - removing white space proves real parsing
|
||||
self.call(building.CmdSetAttribute(),
|
||||
|
|
@ -578,19 +578,19 @@ class TestBuilding(CommandTest):
|
|||
self.call(building.CmdSetAttribute(),
|
||||
"Obj/test2['five'] =", "Obj has no attribute 'test2['five']'.")
|
||||
self.call(building.CmdSetAttribute(),
|
||||
"Obj/test2[@]=42", "Modified attribute Obj/test2 = {'one': 99, 'three': 3, '@': 42}")
|
||||
"Obj/test2[+]=42", "Modified attribute Obj/test2 = {'one': 99, 'three': 3, '+': 42}")
|
||||
self.call(building.CmdSetAttribute(),
|
||||
"Obj/test2[@1]=33",
|
||||
"Modified attribute Obj/test2 = {'one': 99, 'three': 3, '@': 42, '@1': 33}")
|
||||
"Obj/test2[+1]=33",
|
||||
"Modified attribute Obj/test2 = {'one': 99, 'three': 3, '+': 42, '+1': 33}")
|
||||
|
||||
# tuple
|
||||
self.call(building.CmdSetAttribute(), "Obj/tup = (1,2)", "Created attribute Obj/tup = (1, 2)")
|
||||
self.call(building.CmdSetAttribute(),
|
||||
"Obj/tup[1] = 99", "'tuple' object does not support item assignment - (1, 2)")
|
||||
self.call(building.CmdSetAttribute(),
|
||||
"Obj/tup[@] = 99", "'tuple' object does not support item assignment - (1, 2)")
|
||||
"Obj/tup[+] = 99", "'tuple' object does not support item assignment - (1, 2)")
|
||||
self.call(building.CmdSetAttribute(),
|
||||
"Obj/tup[@1] = 99", "'tuple' object does not support item assignment - (1, 2)")
|
||||
"Obj/tup[+1] = 99", "'tuple' object does not support item assignment - (1, 2)")
|
||||
self.call(building.CmdSetAttribute(),
|
||||
# Special case for tuple, could have a better message
|
||||
"Obj/tup[1] = ", "Obj has no attribute 'tup[1]'.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue