From f0ba96e23e5ef745a4558d72a837cce9e72e2aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Tue, 14 Jul 2015 10:04:41 +0200 Subject: [PATCH] fix Typer.genprefix() code broken in recent code cleanup Unfortunately not covered by the existing test suite, and only added a TODO note to add the missing tests. --- TODO.txt | 19 +++++++++++++++++-- suds/mx/typer.py | 4 ++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/TODO.txt b/TODO.txt index c0c9799..5aec7f9 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1503,13 +1503,22 @@ PRIORITIZED: (+) * (Jurko) Review and commit unpublished cleanup work on Jurko's machine. -(01.06.2015.) +(01.07.2015.) (+) * (Jurko) Fix recursive XSD import issue. (+) * Add tests. (+) * Fix issue. -(02.06.2015.) +(14.07.2015.) + +(+) * (Jurko) Fix issue https://bitbucket.org/jurko/suds/issues/90 - code in +(+) `mx/typer.py` Typer.genprefix() broken by commit +(+) 103efca86cd07e9d7205ffb2735748f275a4b35f. +(+) * Add todo note to improve test coverage that managed to miss this +(+) problem. +(+) * Fix. + +(15.07.2015.) * (Jurko) Review and commit unpublished cleanup work on Jurko's machine. @@ -1922,10 +1931,16 @@ PRIORITIZED: * (Jurko) Look into issues #7 & #13 on BitBucket - problems loading a WSDL containing a recursively defined XML schema. + * Possibly already fixed by related work done around 01.07.2015. NON PRIORITIZED: ================================================= + * Add tests for Typer.genprefix(). + * Got broken in commit 103efca86cd07e9d7205ffb2735748f275a4b35f and + fixed as part of issue https://bitbucket.org/jurko/suds/issues/90 but + the bug was missed by the existing test suite. + * suds.sudsobject.footprint() does some fancy recursive counting while all it is actually used for is for detecting objects with footprint 0. This could be optimized by replacing it with a function returning simply diff --git a/suds/mx/typer.py b/suds/mx/typer.py index a2a2793..3533ddc 100644 --- a/suds/mx/typer.py +++ b/suds/mx/typer.py @@ -109,8 +109,8 @@ class Typer: @rtype: (prefix, URI) """ - for node in range(1, 1024): - prefix = "ns%d" % (node,) + for i in range(1, 1024): + prefix = "ns%d" % (i,) uri = node.resolvePrefix(prefix, default=None) if uri in (None, ns[1]): return prefix, ns[1]