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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexander Emmerich
erp5
Commits
58c1456d
Commit
58c1456d
authored
Dec 14, 2012
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unicode strings were coming from json, use utf8 strings instead to avoid rmtree errors
parent
fa309128
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+0
-1
erp5/util/testnode/__init__.py
erp5/util/testnode/__init__.py
+0
-3
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+16
-1
No files found.
erp5/tests/testERP5TestNode.py
View file @
58c1456d
...
@@ -474,6 +474,5 @@ branch = foo
...
@@ -474,6 +474,5 @@ branch = foo
non_ascii_file
=
open
(
os
.
path
.
join
(
controler
.
software_root
,
file_name
),
'w'
)
non_ascii_file
=
open
(
os
.
path
.
join
(
controler
.
software_root
,
file_name
),
'w'
)
non_ascii_file
.
close
()
non_ascii_file
.
close
()
self
.
assertEquals
([
file_name
],
os
.
listdir
(
controler
.
software_root
))
self
.
assertEquals
([
file_name
],
os
.
listdir
(
controler
.
software_root
))
controler
.
software_root
=
unicode
(
controler
.
software_root
)
controler
.
_resetSoftware
()
controler
.
_resetSoftware
()
self
.
assertEquals
([],
os
.
listdir
(
controler
.
software_root
))
self
.
assertEquals
([],
os
.
listdir
(
controler
.
software_root
))
erp5/util/testnode/__init__.py
View file @
58c1456d
...
@@ -81,9 +81,6 @@ def main(*args):
...
@@ -81,9 +81,6 @@ def main(*args):
for
key
in
(
'slapos_directory'
,
'working_directory'
,
'test_suite_directory'
,
for
key
in
(
'slapos_directory'
,
'working_directory'
,
'test_suite_directory'
,
'log_directory'
,
'run_directory'
):
'log_directory'
,
'run_directory'
):
d
=
CONFIG
[
key
]
d
=
CONFIG
[
key
]
if
isinstance
(
d
,
unicode
):
d
=
d
.
encode
(
'utf8'
)
CONFIG
[
key
]
=
d
if
not
os
.
path
.
isdir
(
d
):
if
not
os
.
path
.
isdir
(
d
):
raise
ValueError
(
'Directory %r does not exists.'
%
d
)
raise
ValueError
(
'Directory %r does not exists.'
%
d
)
CONFIG
[
'master_url'
]
=
'http://%s:%s'
%
(
CONFIG
[
'proxy_host'
],
CONFIG
[
'master_url'
]
=
'http://%s:%s'
%
(
CONFIG
[
'proxy_host'
],
...
...
erp5/util/testnode/testnode.py
View file @
58c1456d
...
@@ -63,6 +63,21 @@ class SlapOSInstance(object):
...
@@ -63,6 +63,21 @@ class SlapOSInstance(object):
def
_checkData
(
self
):
def
_checkData
(
self
):
pass
pass
def
deunicodeData
(
data
):
if
isinstance
(
data
,
list
):
new_data
=
[]
for
sub_data
in
data
:
new_data
.
append
(
deunicodeData
(
sub_data
))
elif
isinstance
(
data
,
unicode
):
new_data
=
data
.
encode
(
'utf8'
)
elif
isinstance
(
data
,
dict
):
new_data
=
{}
for
key
,
value
in
data
.
iteritems
():
key
=
deunicodeData
(
key
)
value
=
deunicodeData
(
value
)
new_data
[
key
]
=
value
return
new_data
class
NodeTestSuite
(
SlapOSInstance
):
class
NodeTestSuite
(
SlapOSInstance
):
def
__init__
(
self
,
reference
):
def
__init__
(
self
,
reference
):
...
@@ -344,7 +359,7 @@ branch = %(branch)s
...
@@ -344,7 +359,7 @@ branch = %(branch)s
portal
=
taskdistribution
.
TaskDistributionTool
(
portal_url
,
logger
=
DummyLogger
(
log
))
portal
=
taskdistribution
.
TaskDistributionTool
(
portal_url
,
logger
=
DummyLogger
(
log
))
test_suite_portal
=
taskdistribution
.
TaskDistributor
(
portal_url
,
logger
=
DummyLogger
(
log
))
test_suite_portal
=
taskdistribution
.
TaskDistributor
(
portal_url
,
logger
=
DummyLogger
(
log
))
test_suite_json
=
test_suite_portal
.
startTestSuite
(
config
[
'test_node_title'
])
test_suite_json
=
test_suite_portal
.
startTestSuite
(
config
[
'test_node_title'
])
test_suite_data
=
json
.
loads
(
test_suite_json
)
test_suite_data
=
deunicodeData
(
json
.
loads
(
test_suite_json
)
)
log
(
"Got following test suite data from master : %r"
%
\
log
(
"Got following test suite data from master : %r"
%
\
(
test_suite_data
,))
(
test_suite_data
,))
#Clean-up test suites
#Clean-up test suites
...
...
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