Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
493e7e26
Commit
493e7e26
authored
Sep 23, 2022
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py2/py3: stop using apply().
parent
126ae257
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
product/ERP5/tests/erp5_url_checker.py
product/ERP5/tests/erp5_url_checker.py
+1
-1
product/ERP5Type/tests/Python3StyleTest.py
product/ERP5Type/tests/Python3StyleTest.py
+7
-5
product/Formulator/tests/testFormValidator.py
product/Formulator/tests/testFormValidator.py
+1
-1
No files found.
product/ERP5/tests/erp5_url_checker.py
View file @
493e7e26
...
@@ -116,7 +116,7 @@ class URLOpener(FancyURLopener):
...
@@ -116,7 +116,7 @@ class URLOpener(FancyURLopener):
if
auth
:
h
.
putheader
(
'Authorization'
,
'Basic %s'
%
auth
)
if
auth
:
h
.
putheader
(
'Authorization'
,
'Basic %s'
%
auth
)
if
realhost
:
h
.
putheader
(
'Host'
,
realhost
)
if
realhost
:
h
.
putheader
(
'Host'
,
realhost
)
for
args
in
self
.
addheaders
:
apply
(
h
.
putheader
,
args
)
for
args
in
self
.
addheaders
:
h
.
putheader
(
*
args
)
h
.
endheaders
()
h
.
endheaders
()
if
data
is
not
None
:
if
data
is
not
None
:
h
.
send
(
data
+
'
\
r
\
n
'
)
h
.
send
(
data
+
'
\
r
\
n
'
)
...
...
product/ERP5Type/tests/Python3StyleTest.py
View file @
493e7e26
...
@@ -75,18 +75,20 @@ class Python3StyleTest(ERP5TypeTestCase):
...
@@ -75,18 +75,20 @@ class Python3StyleTest(ERP5TypeTestCase):
if
error
:
if
error
:
self
.
fail
(
error
)
self
.
fail
(
error
)
def
test_raiseFixApplied
(
self
):
def
test_applyFixApplied
(
self
):
self
.
_testFixer
(
'raise'
)
self
.
_testFixer
(
'apply'
)
def
test_importFixApplied
(
self
):
self
.
_testFixer
(
'import'
)
def
test_hasKeyFixApplied
(
self
):
def
test_hasKeyFixApplied
(
self
):
self
.
_testFixer
(
'has_key'
)
self
.
_testFixer
(
'has_key'
)
def
test_importFixApplied
(
self
):
self
.
_testFixer
(
'import'
)
def
test_numliteralsFixApplied
(
self
):
def
test_numliteralsFixApplied
(
self
):
self
.
_testFixer
(
'numliterals'
)
self
.
_testFixer
(
'numliterals'
)
def
test_raiseFixApplied
(
self
):
self
.
_testFixer
(
'raise'
)
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
=
unittest
.
TestSuite
()
...
...
product/Formulator/tests/testFormValidator.py
View file @
493e7e26
...
@@ -27,7 +27,7 @@ class TestField:
...
@@ -27,7 +27,7 @@ class TestField:
class
ValidatorTestCase
(
unittest
.
TestCase
):
class
ValidatorTestCase
(
unittest
.
TestCase
):
def
assertValidatorRaises
(
self
,
exception
,
error_key
,
f
,
*
args
,
**
kw
):
def
assertValidatorRaises
(
self
,
exception
,
error_key
,
f
,
*
args
,
**
kw
):
try
:
try
:
apply
(
f
,
args
,
kw
)
f
(
*
args
,
**
kw
)
except
exception
as
e
:
except
exception
as
e
:
if
hasattr
(
e
,
'error_key'
)
and
e
.
error_key
!=
error_key
:
if
hasattr
(
e
,
'error_key'
)
and
e
.
error_key
!=
error_key
:
self
.
fail
(
'Got wrong error. Expected %s received %s'
%
self
.
fail
(
'Got wrong error. Expected %s received %s'
%
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment