diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-06-23 16:35:47 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-06-23 16:35:47 +0200 |
commit | dee2e315d786cbe9d5bba2d388fb72d96ad1a846 (patch) | |
tree | 3a8548edebc6f07c6b08a3d2017dcb877f351bb4 /src/testdir | |
parent | ede3e6383d0bc86c13f039e9013ff72e307937d2 (diff) |
updated for version 7.3.1236v7.3.1236
Problem: Python: WindowSetattr() missing support for NUMBER_UNSIGNED.
Solution: Add NUMBER_UNSIGNED, add more tests. Various fixes. (ZyX)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/pythonx/failing.py | 1 | ||||
-rw-r--r-- | src/testdir/pythonx/failing_import.py | 1 | ||||
-rw-r--r-- | src/testdir/pythonx/topmodule/__init__.py | 1 | ||||
-rw-r--r-- | src/testdir/pythonx/topmodule/submodule/__init__.py | 1 | ||||
-rw-r--r-- | src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py | 1 | ||||
-rw-r--r-- | src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py | 1 | ||||
-rw-r--r-- | src/testdir/test86.in | 119 | ||||
-rw-r--r-- | src/testdir/test86.ok | 258 | ||||
-rw-r--r-- | src/testdir/test87.in | 100 | ||||
-rw-r--r-- | src/testdir/test87.ok | 258 |
10 files changed, 531 insertions, 210 deletions
diff --git a/src/testdir/pythonx/failing.py b/src/testdir/pythonx/failing.py new file mode 100644 index 0000000000..30e73a0452 --- /dev/null +++ b/src/testdir/pythonx/failing.py @@ -0,0 +1 @@ +raise NotImplementedError diff --git a/src/testdir/pythonx/failing_import.py b/src/testdir/pythonx/failing_import.py new file mode 100644 index 0000000000..511cae7d71 --- /dev/null +++ b/src/testdir/pythonx/failing_import.py @@ -0,0 +1 @@ +raise ImportError diff --git a/src/testdir/pythonx/topmodule/__init__.py b/src/testdir/pythonx/topmodule/__init__.py new file mode 100644 index 0000000000..792d600548 --- /dev/null +++ b/src/testdir/pythonx/topmodule/__init__.py @@ -0,0 +1 @@ +# diff --git a/src/testdir/pythonx/topmodule/submodule/__init__.py b/src/testdir/pythonx/topmodule/submodule/__init__.py new file mode 100644 index 0000000000..792d600548 --- /dev/null +++ b/src/testdir/pythonx/topmodule/submodule/__init__.py @@ -0,0 +1 @@ +# diff --git a/src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py b/src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py new file mode 100644 index 0000000000..792d600548 --- /dev/null +++ b/src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py @@ -0,0 +1 @@ +# diff --git a/src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py b/src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py new file mode 100644 index 0000000000..792d600548 --- /dev/null +++ b/src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py @@ -0,0 +1 @@ +# diff --git a/src/testdir/test86.in b/src/testdir/test86.in index d8afc96d46..61b24ac8c9 100644 --- a/src/testdir/test86.in +++ b/src/testdir/test86.in @@ -216,6 +216,7 @@ EOF :let messages=[] :delfunction DictNew py <<EOF +import sys d=vim.bindeval('{}') m=vim.bindeval('messages') def em(expr, g=globals(), l=locals()): @@ -297,7 +298,7 @@ EOF :" threading :let l = [0] :py l=vim.bindeval('l') -:py <<EOF +py <<EOF import threading import time @@ -327,7 +328,7 @@ EOF :" settrace :let l = [] :py l=vim.bindeval('l') -:py <<EOF +py <<EOF import sys def traceit(frame, event, arg): @@ -342,9 +343,9 @@ def trace_main(): EOF :py sys.settrace(traceit) :py trace_main() +:py sys.settrace(None) :py del traceit :py del trace_main -:py sys.settrace(None) :$put =string(l) :" :" Slice @@ -880,10 +881,16 @@ def ee(expr, g=globals(), l=locals()): if expr.find('None') > -1: msg = msg.replace('TypeError:(\'iteration over non-sequence\',)', 'TypeError:("\'NoneType\' object is not iterable",)') + if expr.find('FailingNumber') > -1: + msg = msg.replace(', not \'FailingNumber\'', '').replace('"', '\'') + msg = msg.replace('TypeError:(\'iteration over non-sequence\',)', + 'TypeError:("\'FailingNumber\' object is not iterable",)') + if msg.find('(\'\'') > -1 or msg.find('(\'can\'t') > -1: + msg = msg.replace('(\'', '("').replace('\',)', '",)') if expr == 'fd(self=[])': # HACK: PyMapping_Check changed meaning msg = msg.replace('AttributeError:(\'keys\',)', - 'TypeError:(\'unable to convert object to vim dictionary\',)') + 'TypeError:(\'unable to convert list to vim dictionary\',)') cb.append(expr + ':' + msg) else: cb.append(expr + ':NOT FAILED') @@ -942,6 +949,7 @@ def convertfrompyobject_test(expr, recurse=True): '{u"": 1}', # Same, but with unicode object 'FailingMapping()', # 'FailingMappingKey()', # + 'FailingNumber()', # )) def convertfrompymapping_test(expr): @@ -956,66 +964,104 @@ def iter_test(expr): 'FailingIterNext()', )) +def number_test(expr, natural=False, unsigned=False): + if natural: + unsigned = True + return subexpr_test(expr, 'NumberToLong', ( + '[]', + 'None', + ) + (unsigned and ('-1',) or ()) + + (natural and ('0',) or ())) + class FailingTrue(object): def __nonzero__(self): - raise NotImplementedError + raise NotImplementedError('bool') class FailingIter(object): def __iter__(self): - raise NotImplementedError + raise NotImplementedError('iter') class FailingIterNext(object): def __iter__(self): return self def next(self): - raise NotImplementedError + raise NotImplementedError('next') class FailingMappingKey(object): def __getitem__(self, item): - raise NotImplementedError + raise NotImplementedError('getitem:mappingkey') def keys(self): return list("abcH") class FailingMapping(object): def __getitem__(self): - raise NotImplementedError + raise NotImplementedError('getitem:mapping') def keys(self): - raise NotImplementedError + raise NotImplementedError('keys') class FailingList(list): def __getitem__(self, idx): if i == 2: - raise NotImplementedError + raise NotImplementedError('getitem:list') else: return super(FailingList, self).__getitem__(idx) +class NoArgsCall(object): + def __call__(self): + pass + +class FailingCall(object): + def __call__(self, path): + raise NotImplementedError('call') + +class FailingNumber(object): + def __int__(self): + raise NotImplementedError('int') + cb.append("> Output") cb.append(">> OutputSetattr") ee('del sys.stdout.softspace') -ee('sys.stdout.softspace = []') +number_test('sys.stdout.softspace = %s', unsigned=True) +number_test('sys.stderr.softspace = %s', unsigned=True) ee('sys.stdout.attr = None') cb.append(">> OutputWrite") ee('sys.stdout.write(None)') cb.append(">> OutputWriteLines") ee('sys.stdout.writelines(None)') ee('sys.stdout.writelines([1])') -#iter_test('sys.stdout.writelines(%s)') +iter_test('sys.stdout.writelines(%s)') cb.append("> VimCommand") -ee('vim.command(1)') +stringtochars_test('vim.command(%s)') +ee('vim.command("", 2)') #! Not checked: vim->python exceptions translating: checked later cb.append("> VimToPython") #! Not checked: everything: needs errors in internal python functions cb.append("> VimEval") -ee('vim.eval(1)') +stringtochars_test('vim.eval(%s)') +ee('vim.eval("", FailingTrue())') #! Not checked: everything: needs errors in internal python functions cb.append("> VimEvalPy") -ee('vim.bindeval(1)') +stringtochars_test('vim.bindeval(%s)') +ee('vim.eval("", 2)') #! Not checked: vim->python exceptions translating: checked later cb.append("> VimStrwidth") -ee('vim.strwidth(1)') +stringtochars_test('vim.strwidth(%s)') +cb.append("> VimForeachRTP") +ee('vim.foreach_rtp(None)') +ee('vim.foreach_rtp(NoArgsCall())') +ee('vim.foreach_rtp(FailingCall())') +ee('vim.foreach_rtp(int, 2)') +cb.append('> import') +old_rtp = vim.options['rtp'] +vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') +ee('import xxx_no_such_module_xxx') +ee('import failing_import') +ee('import failing') +vim.options['rtp'] = old_rtp +del old_rtp cb.append("> Dictionary") cb.append(">> DictionaryConstructor") ee('vim.Dictionary("abcI")') @@ -1043,7 +1089,7 @@ cb.append(">>> kwargs") cb.append(">>> iter") ee('d.update(FailingMapping())') ee('d.update([FailingIterNext()])') -#iter_test('d.update(%s)') +iter_test('d.update(%s)') convertfrompyobject_test('d.update(%s)') stringtochars_test('d.update(((%s, 0),))') convertfrompyobject_test('d.update((("a", %s),))') @@ -1055,7 +1101,7 @@ cb.append("> List") cb.append(">> ListConstructor") ee('vim.List(1, 2)') ee('vim.List(a=1)') -#iter_test('vim.List(%s)') +iter_test('vim.List(%s)') convertfrompyobject_test('vim.List([%s])') cb.append(">> ListItem") ee('l[1000]') @@ -1064,10 +1110,10 @@ ee('ll[1] = 2') ee('l[1000] = 3') cb.append(">> ListAssSlice") ee('ll[1:100] = "abcJ"') -#iter_test('l[:] = %s') +iter_test('l[:] = %s') convertfrompyobject_test('l[:] = [%s]') cb.append(">> ListConcatInPlace") -#iter_test('l.extend(%s)') +iter_test('l.extend(%s)') convertfrompyobject_test('l.extend([%s])') cb.append(">> ListSetattr") ee('del l.locked') @@ -1094,14 +1140,15 @@ cb.append(">> WindowSetattr") ee('vim.current.window.buffer = 0') ee('vim.current.window.cursor = (100000000, 100000000)') ee('vim.current.window.cursor = True') -ee('vim.current.window.height = "abcK"') -ee('vim.current.window.width = "abcL"') +number_test('vim.current.window.height = %s', unsigned=True) +number_test('vim.current.window.width = %s', unsigned=True) ee('vim.current.window.xxxxxx = True') cb.append("> WinList") cb.append(">> WinListItem") ee('vim.windows[1000]') cb.append("> Buffer") cb.append(">> StringToLine (indirect)") +ee('vim.current.buffer[0] = u"\\na"') ee('vim.current.buffer[0] = "\\na"') cb.append(">> SetBufferLine (indirect)") ee('vim.current.buffer[0] = True') @@ -1129,8 +1176,8 @@ cb.append(">> BufferRange") ee('vim.current.buffer.range(1, 2, 3)') cb.append("> BufMap") cb.append(">> BufMapItem") -ee('vim.buffers[None]') ee('vim.buffers[100000000]') +number_test('vim.buffers[%s]', natural=True) cb.append("> Current") cb.append(">> CurrentGetattr") ee('vim.current.xxx') @@ -1154,12 +1201,16 @@ del Mapping del convertfrompyobject_test del convertfrompymapping_test del iter_test +del number_test del FailingTrue del FailingIter del FailingIterNext del FailingMapping del FailingMappingKey del FailingList +del NoArgsCall +del FailingCall +del FailingNumber EOF :delfunction F :" @@ -1168,6 +1219,16 @@ py << EOF sys.path.insert(0, os.path.join(os.getcwd(), 'python_before')) sys.path.append(os.path.join(os.getcwd(), 'python_after')) vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') +l = [] +def callback(path): + l.append(path[-len('/testdir'):]) +vim.foreach_rtp(callback) +cb.append(repr(l)) +del l +def callback(path): + return path[-len('/testdir'):] +cb.append(repr(vim.foreach_rtp(callback))) +del callback from module import dir as d from modulex import ddir cb.append(d + ',' + ddir) @@ -1175,10 +1236,19 @@ import before cb.append(before.dir) import after cb.append(after.dir) +import topmodule as tm +import topmodule.submodule as tms +import topmodule.submodule.subsubmodule.subsubsubmodule as tmsss +cb.append(tm.__file__.replace('.pyc', '.py')[-len('modulex/topmodule/__init__.py'):]) +cb.append(tms.__file__.replace('.pyc', '.py')[-len('modulex/topmodule/submodule/__init__.py'):]) +cb.append(tmsss.__file__.replace('.pyc', '.py')[-len('modulex/topmodule/submodule/subsubmodule/subsubsubmodule.py'):]) del before del after del d del ddir +del tm +del tms +del tmsss EOF :" :" Test exceptions @@ -1232,6 +1302,7 @@ EOF :call garbagecollect(1) :" :/^start:/,$wq! test.out +:" vim: et ts=4 isk-=\: :call getchar() ENDTEST diff --git a/src/testdir/test86.ok b/src/testdir/test86.ok index b4abcc28c9..6fdab0ccf0 100644 --- a/src/testdir/test86.ok +++ b/src/testdir/test86.ok @@ -441,28 +441,69 @@ test86.in > Output >> OutputSetattr del sys.stdout.softspace:AttributeError:("can't delete OutputObject attributes",) +>>> Testing NumberToLong using sys.stdout.softspace = %s sys.stdout.softspace = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',) +sys.stdout.softspace = None:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',) +sys.stdout.softspace = -1:ValueError:('number must be greater or equal to zero',) +<<< Finished +>>> Testing NumberToLong using sys.stderr.softspace = %s +sys.stderr.softspace = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',) +sys.stderr.softspace = None:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',) +sys.stderr.softspace = -1:ValueError:('number must be greater or equal to zero',) +<<< Finished sys.stdout.attr = None:AttributeError:('invalid attribute: attr',) >> OutputWrite sys.stdout.write(None):TypeError:('coercing to Unicode: need string or buffer, NoneType found',) >> OutputWriteLines sys.stdout.writelines(None):TypeError:("'NoneType' object is not iterable",) sys.stdout.writelines([1]):TypeError:('coercing to Unicode: need string or buffer, int found',) +>>> Testing *Iter* using sys.stdout.writelines(%s) +sys.stdout.writelines(FailingIter()):NotImplementedError:('iter',) +sys.stdout.writelines(FailingIterNext()):NotImplementedError:('next',) +<<< Finished > VimCommand +>>> Testing StringToChars using vim.command(%s) vim.command(1):TypeError:('expected str() or unicode() instance, but got int',) +vim.command(u"\0"):TypeError:('expected string without null bytes',) +vim.command("\0"):TypeError:('expected string without null bytes',) +<<< Finished +vim.command("", 2):TypeError:('command() takes exactly one argument (2 given)',) > VimToPython > VimEval +>>> Testing StringToChars using vim.eval(%s) vim.eval(1):TypeError:('expected str() or unicode() instance, but got int',) +vim.eval(u"\0"):TypeError:('expected string without null bytes',) +vim.eval("\0"):TypeError:('expected string without null bytes',) +<<< Finished +vim.eval("", FailingTrue()):TypeError:('function takes exactly 1 argument (2 given)',) > VimEvalPy +>>> Testing StringToChars using vim.bindeval(%s) vim.bindeval(1):TypeError:('expected str() or unicode() instance, but got int',) +vim.bindeval(u"\0"):TypeError:('expected string without null bytes',) +vim.bindeval("\0"):TypeError:('expected string without null bytes',) +<<< Finished +vim.eval("", 2):TypeError:('function takes exactly 1 argument (2 given)',) > VimStrwidth +>>> Testing StringToChars using vim.strwidth(%s) vim.strwidth(1):TypeError:('expected str() or unicode() instance, but got int',) +vim.strwidth(u"\0"):TypeError:('expected string without null bytes',) +vim.strwidth("\0"):TypeError:('expected string without null bytes',) +<<< Finished +> VimForeachRTP +vim.foreach_rtp(None):TypeError:("'NoneType' object is not callable",) +vim.foreach_rtp(NoArgsCall()):TypeError:('__call__() takes exactly 1 argument (2 given)',) +vim.foreach_rtp(FailingCall()):NotImplementedError:('call',) +vim.foreach_rtp(int, 2):TypeError:('foreach_rtp() takes exactly one argument (2 given)',) +> import +import xxx_no_such_module_xxx:ImportError:('No module named xxx_no_such_module_xxx',) +import failing_import:ImportError:('No module named failing_import',) +import failing:ImportError:('No module named failing',) > Dictionary >> DictionaryConstructor vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but got sequence of size 1',) >> DictionarySetattr del d.locked:AttributeError:('cannot delete vim.Dictionary attributes',) -d.locked = FailingTrue():NotImplementedError:() +d.locked = FailingTrue():NotImplementedError:('bool',) vim.vvars.locked = False:TypeError:('cannot modify fixed dictionary',) d.scope = True:AttributeError:('cannot set attribute scope',) d.xxx = True:AttributeError:('cannot set attribute xxx',) @@ -501,14 +542,15 @@ d["a"] = {"abcF" : Mapping({"\0" : 1})}:TypeError:('expected string without null <<< Finished >>> Testing *Iter* using d["a"] = {"abcF" : %s} d["a"] = {"abcF" : FailingIter()}:TypeError:('unable to convert FailingIter to vim structure',) -d["a"] = {"abcF" : FailingIterNext()}:NotImplementedError:() +d["a"] = {"abcF" : FailingIterNext()}:NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using d["a"] = {"abcF" : %s} d["a"] = {"abcF" : None}:TypeError:('unable to convert NoneType to vim structure',) d["a"] = {"abcF" : {"": 1}}:ValueError:('empty keys are not allowed',) d["a"] = {"abcF" : {u"": 1}}:ValueError:('empty keys are not allowed',) -d["a"] = {"abcF" : FailingMapping()}:NotImplementedError:() -d["a"] = {"abcF" : FailingMappingKey()}:NotImplementedError:() +d["a"] = {"abcF" : FailingMapping()}:NotImplementedError:('keys',) +d["a"] = {"abcF" : FailingMappingKey()}:NotImplementedError:('getitem:mappingkey',) +d["a"] = {"abcF" : FailingNumber()}:TypeError:('long() argument must be a string or a number',) <<< Finished >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) d["a"] = Mapping({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',) @@ -527,31 +569,37 @@ d["a"] = Mapping({"abcG" : Mapping({"\0" : 1})}):TypeError:('expected string wit <<< Finished >>> Testing *Iter* using d["a"] = Mapping({"abcG" : %s}) d["a"] = Mapping({"abcG" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) -d["a"] = Mapping({"abcG" : FailingIterNext()}):NotImplementedError:() +d["a"] = Mapping({"abcG" : FailingIterNext()}):NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abcG" : %s}) d["a"] = Mapping({"abcG" : None}):TypeError:('unable to convert NoneType to vim structure',) d["a"] = Mapping({"abcG" : {"": 1}}):ValueError:('empty keys are not allowed',) d["a"] = Mapping({"abcG" : {u"": 1}}):ValueError:('empty keys are not allowed',) -d["a"] = Mapping({"abcG" : FailingMapping()}):NotImplementedError:() -d["a"] = Mapping({"abcG" : FailingMappingKey()}):NotImplementedError:() +d["a"] = Mapping({"abcG" : FailingMapping()}):NotImplementedError:('keys',) +d["a"] = Mapping({"abcG" : FailingMappingKey()}):NotImplementedError:('getitem:mappingkey',) +d["a"] = Mapping({"abcG" : FailingNumber()}):TypeError:('long() argument must be a string or a number',) <<< Finished >>> Testing *Iter* using d["a"] = %s d["a"] = FailingIter():TypeError:('unable to convert FailingIter to vim structure',) -d["a"] = FailingIterNext():NotImplementedError:() +d["a"] = FailingIterNext():NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using d["a"] = %s d["a"] = None:TypeError:('unable to convert NoneType to vim structure',) d["a"] = {"": 1}:ValueError:('empty keys are not allowed',) d["a"] = {u"": 1}:ValueError:('empty keys are not allowed',) -d["a"] = FailingMapping():NotImplementedError:() -d["a"] = FailingMappingKey():NotImplementedError:() +d["a"] = FailingMapping():NotImplementedError:('keys',) +d["a"] = FailingMappingKey():NotImplementedError:('getitem:mappingkey',) +d["a"] = FailingNumber():TypeError:('long() argument must be a string or a number',) <<< Finished >> DictionaryUpdate >>> kwargs >>> iter -d.update(FailingMapping()):NotImplementedError:() -d.update([FailingIterNext()]):NotImplementedError:() +d.update(FailingMapping()):NotImplementedError:('keys',) +d.update([FailingIterNext()]):NotImplementedError:('next',) +>>> Testing *Iter* using d.update(%s) +d.update(FailingIter()):NotImplementedError:('iter',) +d.update(FailingIterNext()):NotImplementedError:('next',) +<<< Finished >>> Testing StringToChars using d.update({%s : 1}) d.update({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',) d.update({u"\0" : 1}):TypeError:('expected string without null bytes',) @@ -569,14 +617,15 @@ d.update({"abcF" : Mapping({"\0" : 1})}):TypeError:('expected string without nul <<< Finished >>> Testing *Iter* using d.update({"abcF" : %s}) d.update({"abcF" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) -d.update({"abcF" : FailingIterNext()}):NotImplementedError:() +d.update({"abcF" : FailingIterNext()}):NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using d.update({"abcF" : %s}) d.update({"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',) d.update({"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',) d.update({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',) -d.update({"abcF" : FailingMapping()}):NotImplementedError:() -d.update({"abcF" : FailingMappingKey()}):NotImplementedError:() +d.update({"abcF" : FailingMapping()}):NotImplementedError:('keys',) +d.update({"abcF" : FailingMappingKey()}):NotImplementedError:('getitem:mappingkey',) +d.update({"abcF" : FailingNumber()}):TypeError:('long() argument must be a string or a number',) <<< Finished >>> Testing StringToChars using d.update(Mapping({%s : 1})) d.update(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) @@ -595,25 +644,27 @@ d.update(Mapping({"abcG" : Mapping({"\0" : 1})})):TypeError:('expected string wi <<< Finished >>> Testing *Iter* using d.update(Mapping({"abcG" : %s})) d.update(Mapping({"abcG" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) -d.update(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:() +d.update(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using d.update(Mapping({"abcG" : %s})) d.update(Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',) d.update(Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',) d.update(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',) -d.update(Mapping({"abcG" : FailingMapping()})):NotImplementedError:() -d.update(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:() +d.update(Mapping({"abcG" : FailingMapping()})):NotImplementedError:('keys',) +d.update(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:('getitem:mappingkey',) +d.update(Mapping({"abcG" : FailingNumber()})):TypeError:('long() argument must be a string or a number',) <<< Finished >>> Testing *Iter* using d.update(%s) -d.update(FailingIter()):NotImplementedError:() -d.update(FailingIterNext()):NotImplementedError:() +d.update(FailingIter()):NotImplementedError:('iter',) +d.update(FailingIterNext()):NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using d.update(%s) d.update(None):TypeError:("'NoneType' object is not iterable",) d.update({"": 1}):ValueError:('empty keys are not allowed',) d.update({u"": 1}):ValueError:('empty keys are not allowed',) -d.update(FailingMapping()):NotImplementedError:() -d.update(FailingMappingKey()):NotImplementedError:() +d.update(FailingMapping()):NotImplementedError:('keys',) +d.update(FailingMappingKey()):NotImplementedError:('getitem:mappingkey',) +d.update(FailingNumber()):TypeError:("'FailingNumber' object is not iterable",) <<< Finished >>> Testing StringToChars using d.update(((%s, 0),)) d.update(((1, 0),)):TypeError:('expected str() or unicode() instance, but got int',) @@ -637,14 +688,15 @@ d.update((("a", {"abcF" : Mapping({"\0" : 1})}),)):TypeError:('expected string w <<< Finished >>> Testing *Iter* using d.update((("a", {"abcF" : %s}),)) d.update((("a", {"abcF" : FailingIter()}),)):TypeError:('unable to convert FailingIter to vim structure',) -d.update((("a", {"abcF" : FailingIterNext()}),)):NotImplementedError:() +d.update((("a", {"abcF" : FailingIterNext()}),)):NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using d.update((("a", {"abcF" : %s}),)) d.update((("a", {"abcF" : None}),)):TypeError:('unable to convert NoneType to vim structure',) d.update((("a", {"abcF" : {"": 1}}),)):ValueError:('empty keys are not allowed',) d.update((("a", {"abcF" : {u"": 1}}),)):ValueError:('empty keys are not allowed',) -d.update((("a", {"abcF" : FailingMapping()}),)):NotImplementedError:() -d.update((("a", {"abcF" : FailingMappingKey()}),)):NotImplementedError:() +d.update((("a", {"abcF" : FailingMapping()}),)):NotImplementedError:('keys',) +d.update((("a", {"abcF" : FailingMappingKey()}),)):NotImplementedError:('getitem:mappingkey',) +d.update((("a", {"abcF" : FailingNumber()}),)):TypeError:('long() argument must be a string or a number',) <<< Finished >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) d.update((("a", Mapping({1 : 1})),)):TypeError:('expected str() or unicode() instance, but got int',) @@ -663,25 +715,27 @@ d.update((("a", Mapping({"abcG" : Mapping({"\0" : 1})})),)):TypeError:('expected <<< Finished >>> Testing *Iter* using d.update((("a", Mapping({"abcG" : %s})),)) d.update((("a", Mapping({"abcG" : FailingIter()})),)):TypeError:('unable to convert FailingIter to vim structure',) -d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):NotImplementedError:() +d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abcG" : %s})),)) d.update((("a", Mapping({"abcG" : None})),)):TypeError:('unable to convert NoneType to vim structure',) d.update((("a", Mapping({"abcG" : {"": 1}})),)):ValueError:('empty keys are not allowed',) d.update((("a", Mapping({"abcG" : {u"": 1}})),)):ValueError:('empty keys are not allowed',) -d.update((("a", Mapping({"abcG" : FailingMapping()})),)):NotImplementedError:() -d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):NotImplementedError:() +d.update((("a", Mapping({"abcG" : FailingMapping()})),)):NotImplementedError:('keys',) +d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):NotImplementedError:('getitem:mappingkey',) +d.update((("a", Mapping({"abcG" : FailingNumber()})),)):TypeError:('long() argument must be a string or a number',) <<< Finished >>> Testing *Iter* using d.update((("a", %s),)) d.update((("a", FailingIter()),)):TypeError:('unable to convert FailingIter to vim structure',) -d.update((("a", FailingIterNext()),)):NotImplementedError:() +d.update((("a", FailingIterNext()),)):NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using d.update((("a", %s),)) d.update((("a", None),)):TypeError:('unable to convert NoneType to vim structure',) d.update((("a", {"": 1}),)):ValueError:('empty keys are not allowed',) d.update((("a", {u"": 1}),)):ValueError:('empty keys are not allowed',) -d.update((("a", FailingMapping()),)):NotImplementedError:() -d.update((("a", FailingMappingKey()),)):NotImplementedError:() +d.update((("a", FailingMapping()),)):NotImplementedError:('keys',) +d.update((("a", FailingMappingKey()),)):NotImplementedError:('getitem:mappingkey',) +d.update((("a", FailingNumber()),)):TypeError:('long() argument must be a string or a number',) <<< Finished >> DictionaryPopItem d.popitem(1, 2):TypeError:('popitem() takes no arguments (2 given)',) @@ -691,6 +745,10 @@ d.has_key():TypeError:('has_key() takes exactly one argument (0 given)',) >> ListConstructor vim.List(1, 2):TypeError:('function takes at most 1 argument (2 given)',) vim.List(a=1):TypeError:('list constructor does not accept keyword arguments',) +>>> Testing *Iter* using vim.List(%s) +vim.List(FailingIter()):NotImplementedError:('iter',) +vim.List(FailingIterNext()):NotImplementedError:('next',) +<<< Finished >>> Testing StringToChars using vim.List([{%s : 1}]) vim.List([{1 : 1}]):TypeError:('expected str() or unicode() instance, but got int',) vim.List([{u"\0" : 1}]):TypeError:('expected string without null bytes',) @@ -708,14 +766,15 @@ vim.List([{"abcF" : Mapping({"\0" : 1})}]):TypeError:('expected string without n <<< Finished >>> Testing *Iter* using vim.List([{"abcF" : %s}]) vim.List([{"abcF" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',) -vim.List([{"abcF" : FailingIterNext()}]):NotImplementedError:() +vim.List([{"abcF" : FailingIterNext()}]):NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using vim.List([{"abcF" : %s}]) vim.List([{"abcF" : None}]):TypeError:('unable to convert NoneType to vim structure',) vim.List([{"abcF" : {"": 1}}]):ValueError:('empty keys are not allowed',) vim.List([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',) -vim.List([{"abcF" : FailingMapping()}]):NotImplementedError:() -vim.List([{"abcF" : FailingMappingKey()}]):NotImplementedError:() +vim.List([{"abcF" : FailingMapping()}]):NotImplementedError:('keys',) +vim.List([{"abcF" : FailingMappingKey()}]):NotImplementedError:('getitem:mappingkey',) +vim.List([{"abcF" : FailingNumber()}]):TypeError:('long() argument must be a string or a number',) <<< Finished >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) vim.List([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',) @@ -734,25 +793,27 @@ vim.List([Mapping({"abcG" : Mapping({"\0" : 1})})]):TypeError:('expected string <<< Finished >>> Testing *Iter* using vim.List([Mapping({"abcG" : %s})]) vim.List([Mapping({"abcG" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',) -vim.List([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:() +vim.List([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using vim.List([Mapping({"abcG" : %s})]) vim.List([Mapping({"abcG" : None})]):TypeError:('unable to convert NoneType to vim structure',) vim.List([Mapping({"abcG" : {"": 1}})]):ValueError:('empty keys are not allowed',) vim.List([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',) -vim.List([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:() -vim.List([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:() +vim.List([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:('keys',) +vim.List([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:('getitem:mappingkey',) +vim.List([Mapping({"abcG" : FailingNumber()})]):TypeError:('long() argument must be a string or a number',) <<< Finished >>> Testing *Iter* using vim.List([%s]) vim.List([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',) -vim.List([FailingIterNext()]):NotImplementedError:() +vim.List([FailingIterNext()]):NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using vim.List([%s]) vim.List([None]):TypeError:('unable to convert NoneType to vim structure',) vim.List([{"": 1}]):ValueError:('empty keys are not allowed',) vim.List([{u"": 1}]):ValueError:('empty keys are not allowed',) -vim.List([FailingMapping()]):NotImplementedError:() -vim.List([FailingMappingKey()]):NotImplementedError:() +vim.List([FailingMapping()]):NotImplementedError:('keys',) +vim.List([FailingMappingKey()]):NotImplementedError:('getitem:mappingkey',) +vim.List([FailingNumber()]):TypeError:('long() argument must be a string or a number',) <<< Finished >> ListItem l[1000]:IndexError:('list index out of range',) @@ -761,6 +822,10 @@ ll[1] = 2:error:('list is locked',) l[1000] = 3:IndexError:('list index out of range',) >> ListAssSlice ll[1:100] = "abcJ":error:('list is locked',) +>>> Testing *Iter* using l[:] = %s +l[:] = FailingIter():NotImplementedError:('iter',) +l[:] = FailingIterNext():NotImplementedError:('next',) +<<< Finished >>> Testing StringToChars using l[:] = [{%s : 1}] l[:] = [{1 : 1}]:TypeError:('expected str() or unicode() instance, but got int',) l[:] = [{u"\0" : 1}]:TypeError:('expected string without null bytes',) @@ -778,14 +843,15 @@ l[:] = [{"abcF" : Mapping({"\0" : 1})}]:TypeError:('expected string without null <<< Finished >>> Testing *Iter* using l[:] = [{"abcF" : %s}] l[:] = [{"abcF" : FailingIter()}]:TypeError:('unable to convert FailingIter to vim structure',) -l[:] = [{"abcF" : FailingIterNext()}]:NotImplementedError:() +l[:] = [{"abcF" : FailingIterNext()}]:NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using l[:] = [{"abcF" : %s}] l[:] = [{"abcF" : None}]:TypeError:('unable to convert NoneType to vim structure',) l[:] = [{"abcF" : {"": 1}}]:ValueError:('empty keys are not allowed',) l[:] = [{"abcF" : {u"": 1}}]:ValueError:('empty keys are not allowed',) -l[:] = [{"abcF" : FailingMapping()}]:NotImplementedError:() -l[:] = [{"abcF" : FailingMappingKey()}]:NotImplementedError:() +l[:] = [{"abcF" : FailingMapping()}]:NotImplementedError:('keys',) +l[:] = [{"abcF" : FailingMappingKey()}]:NotImplementedError:('getitem:mappingkey',) +l[:] = [{"abcF" : FailingNumber()}]:TypeError:('long() argument must be a string or a number',) <<< Finished >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] l[:] = [Mapping({1 : 1})]:TypeError:('expected str() or unicode() instance, but got int',) @@ -804,27 +870,33 @@ l[:] = [Mapping({"abcG" : Mapping({"\0" : 1})})]:TypeError:('expected string wit <<< Finished >>> Testing *Iter* using l[:] = [Mapping({"abcG" : %s})] l[:] = [Mapping({"abcG" : FailingIter()})]:TypeError:('unable to convert FailingIter to vim structure',) -l[:] = [Mapping({"abcG" : FailingIterNext()})]:NotImplementedError:() +l[:] = [Mapping({"abcG" : FailingIterNext()})]:NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abcG" : %s})] l[:] = [Mapping({"abcG" : None})]:TypeError:('unable to convert NoneType to vim structure',) l[:] = [Mapping({"abcG" : {"": 1}})]:ValueError:('empty keys are not allowed',) l[:] = [Mapping({"abcG" : {u"": 1}})]:ValueError:('empty keys are not allowed',) -l[:] = [Mapping({"abcG" : FailingMapping()})]:NotImplementedError:() -l[:] = [Mapping({"abcG" : FailingMappingKey()})]:NotImplementedError:() +l[:] = [Mapping({"abcG" : FailingMapping()})]:NotImplementedError:('keys',) +l[:] = [Mapping({"abcG" : FailingMappingKey()})]:NotImplementedError:('getitem:mappingkey',) +l[:] = [Mapping({"abcG" : FailingNumber()})]:TypeError:('long() argument must be a string or a number',) <<< Finished >>> Testing *Iter* using l[:] = [%s] l[:] = [FailingIter()]:TypeError:('unable to convert FailingIter to vim structure',) -l[:] = [FailingIterNext()]:NotImplementedError:() +l[:] = [FailingIterNext()]:NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using l[:] = [%s] l[:] = [None]:TypeError:('unable to convert NoneType to vim structure',) l[:] = [{"": 1}]:ValueError:('empty keys are not allowed',) l[:] = [{u"": 1}]:ValueError:('empty keys are not allowed',) -l[:] = [FailingMapping()]:NotImplementedError:() -l[:] = [FailingMappingKey()]:NotImplementedError:() +l[:] = [FailingMapping()]:NotImplementedError:('keys',) +l[:] = [FailingMappingKey()]:NotImplementedError:('getitem:mappingkey',) +l[:] = [FailingNumber()]:TypeError:('long() argument must be a string or a number',) <<< Finished >> ListConcatInPlace +>>> Testing *Iter* using l.extend(%s) +l.extend(FailingIter()):NotImplementedError:('iter',) +l.extend(FailingIterNext()):NotImplementedError:('next',) +<<< Finished >>> Testing StringToChars using l.extend([{%s : 1}]) l.extend([{1 : 1}]):TypeError:('expected str() or unicode() instance, but got int',) l.extend([{u"\0" : 1}]):TypeError:('expected string without null bytes',) @@ -842,14 +914,15 @@ l.extend([{"abcF" : Mapping({"\0" : 1})}]):TypeError:('expected string without n <<< Finished >>> Testing *Iter* using l.extend([{"abcF" : %s}]) l.extend([{"abcF" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',) -l.extend([{"abcF" : FailingIterNext()}]):NotImplementedError:() +l.extend([{"abcF" : FailingIterNext()}]):NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using l.extend([{"abcF" : %s}]) l.extend([{"abcF" : None}]):TypeError:('unable to convert NoneType to vim structure',) l.extend([{"abcF" : {"": 1}}]):ValueError:('empty keys are not allowed',) l.extend([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',) -l.extend([{"abcF" : FailingMapping()}]):NotImplementedError:() -l.extend([{"abcF" : FailingMappingKey()}]):NotImplementedError:() +l.extend([{"abcF" : FailingMapping()}]):NotImplementedError:('keys',) +l.extend([{"abcF" : FailingMappingKey()}]):NotImplementedError:('getitem:mappingkey',) +l.extend([{"abcF" : FailingNumber()}]):TypeError:('long() argument must be a string or a number',) <<< Finished >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) l.extend([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',) @@ -868,29 +941,31 @@ l.extend([Mapping({"abcG" : Mapping({"\0" : 1})})]):TypeError:('expected string <<< Finished >>> Testing *Iter* using l.extend([Mapping({"abcG" : %s})]) l.extend([Mapping({"abcG" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',) -l.extend([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:() +l.extend([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:('next',) <<< Finished >>> Testing ConvertFromPyObject using l.extend([Mapping({"abcG" : %s})]) l.extend([Mapping({"abcG" : None})]):TypeError:('unable to convert NoneType to vim structure',) l.extend([Mapping({"abcG" |