From 3957f12aa2f9552197806bc7efef78ed73b2a82d Mon Sep 17 00:00:00 2001
From: Chris Dent <cdent@anticdent.org>
Date: Mon, 12 Nov 2018 16:14:39 +0100
Subject: [PATCH] Get WSME tests working again

It had been a long time since WSME had any patches, so the
tests had not been run in a while. This corrects errors found
while bring the tests back to work.

Change-Id: I67efc4151d6eaec673b431904aa7288a7501cb43
Co-Authored-By: 98k <18552437190@163.com>
---
 tox.ini           | 6 ++----
 wsme/rest/args.py | 6 +++---
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/tox.ini b/tox.ini
index 4575b7d..9c398e4 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = py27,py27-nolxml,pypy,tg11,tg15,cornice,cornice-py3,coverage,py35,py35-nolxml,pecan-dev27,pecan-dev35,pep8
+envlist = py27,py27-nolxml,pypy,tg11,tg15,cornice,cornice-py3,coverage,py35,py36,py35-nolxml,py36-nolxml,pecan-dev27,pecan-dev35,pecan-dev36,pep8
 
 [common]
 testtools = 
@@ -48,7 +48,7 @@ deps =
 	{[common]testtools}
 	transaction
 	suds-jurko
-	https://github.com/stackforge/pecan/zipball/master
+	https://github.com/pecan/pecan/zipball/master
 
 [testenv:pecan-dev27]
 basepython = python2.7
@@ -71,7 +71,6 @@ setenv =
 commands = 
 	{envbindir}/coverage erase
 	{envbindir}/coverage combine
-	{envbindir}/coverage xml wsme/*.py wsme/rest/*.py wsmeext/*.py
 	{envbindir}/coverage report --show-missing wsme/*.py wsme/protocols/*.py wsmeext/*.py
 
 [testenv:doc]
@@ -869,7 +868,6 @@ deps =
 basepython = python3
 commands = 
 	{envbindir}/coverage run {envbindir}/nosetests --nologcapture --with-xunit --xunit-file nosetests-{envname}.xml wsme/tests wsmeext/tests tests/pecantest tests/test_sphinxext.py tests/test_flask.py --verbose {posargs}
-	{envbindir}/coverage xml -o coverage-{envname}.xml wsme/*.py wsme/rest/*.py wsmeext/*.py
 	{envbindir}/coverage report --show-missing wsme/*.py wsme/rest/*.py wsmeext/*.py
 deps = 
 	{[common]testtools}
diff --git a/wsme/rest/args.py b/wsme/rest/args.py
index 91557fc..9dc16c7 100644
--- a/wsme/rest/args.py
+++ b/wsme/rest/args.py
@@ -102,7 +102,7 @@ def array_from_params(datatype, params, path, hit_paths):
 
     if iscomplex(datatype.item_type):
         attributes = set()
-        r = re.compile('^%s\.(?P<attrname>[^\.])' % re.escape(path))
+        r = re.compile(r'^%s\.(?P<attrname>[^\.])' % re.escape(path))
         for p in params.keys():
             m = r.match(p)
             if m:
@@ -127,7 +127,7 @@ def array_from_params(datatype, params, path, hit_paths):
             return value
 
     indexes = set()
-    r = re.compile('^%s\[(?P<index>\d+)\]' % re.escape(path))
+    r = re.compile(r'^%s\[(?P<index>\d+)\]' % re.escape(path))
 
     for p in params.keys():
         m = r.match(p)
@@ -149,7 +149,7 @@ def array_from_params(datatype, params, path, hit_paths):
 def dict_from_params(datatype, params, path, hit_paths):
 
     keys = set()
-    r = re.compile('^%s\[(?P<key>[a-zA-Z0-9_\.]+)\]' % re.escape(path))
+    r = re.compile(r'^%s\[(?P<key>[a-zA-Z0-9_\.]+)\]' % re.escape(path))
 
     for p in params.keys():
         m = r.match(p)