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
Léo-Paul Géneau
erp5
Commits
42cd1159
Commit
42cd1159
authored
May 19, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testnode: simplify list comprehension in test
parent
66d7df28
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
15 deletions
+20
-15
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+20
-15
No files found.
erp5/tests/testERP5TestNode.py
View file @
42cd1159
...
...
@@ -338,9 +338,10 @@ shared = true
rev_list
=
self
.
getAndUpdateFullRevisionList
(
test_node
,
node_test_suite
)
self
.
assertEqual
(
3
,
len
(
rev_list
))
self
.
assertEqual
(
3
,
len
(
node_test_suite
.
vcs_repository_list
))
rep2_clone_path
=
[
x
[
'repository_path'
]
for
x
in
\
node_test_suite
.
vcs_repository_list
\
if
x
[
'repository_path'
].
endswith
(
"rep2"
)][
0
]
rep2_clone_path
=
next
(
x
[
'repository_path'
]
for
x
in
node_test_suite
.
vcs_repository_list
if
x
[
'repository_path'
].
endswith
(
"rep2"
))
call
=
self
.
getCaller
(
cwd
=
rep2_clone_path
)
output
=
call
(
"git branch"
.
split
()).
strip
()
self
.
assertTrue
(
"* foo"
in
output
.
split
(
'
\
n
'
))
...
...
@@ -395,9 +396,10 @@ shared = true
# change the url of the first repository
vcs_repository_info
=
node_test_suite
.
vcs_repository_list
[
0
]
vcs_repository_info
[
"url"
]
=
self
.
remote_repository2
rep0_clone_path
=
[
x
[
'repository_path'
]
for
x
in
\
node_test_suite
.
vcs_repository_list
\
if
x
[
'repository_path'
].
endswith
(
"rep0"
)][
0
]
rep0_clone_path
=
next
(
x
[
'repository_path'
]
for
x
in
node_test_suite
.
vcs_repository_list
if
x
[
'repository_path'
].
endswith
(
"rep0"
))
call
=
self
.
getCaller
(
cwd
=
rep0_clone_path
)
self
.
assertEqual
(
call
(
"git config --get remote.origin.url"
.
split
()).
strip
(),
self
.
remote_repository0
)
...
...
@@ -422,9 +424,10 @@ shared = true
rev_list
=
self
.
getAndUpdateFullRevisionList
(
test_node
,
node_test_suite
)
self
.
assertEqual
(
2
,
len
(
rev_list
))
self
.
assertEqual
(
2
,
len
(
node_test_suite
.
vcs_repository_list
))
rep0_clone_path
=
[
x
[
'repository_path'
]
for
x
in
\
node_test_suite
.
vcs_repository_list
\
if
x
[
'repository_path'
].
endswith
(
"rep0"
)][
0
]
rep0_clone_path
=
next
(
x
[
'repository_path'
]
for
x
in
node_test_suite
.
vcs_repository_list
if
x
[
'repository_path'
].
endswith
(
"rep0"
))
my_file
=
open
(
os
.
path
.
join
(
rep0_clone_path
,
'first_file'
),
'w'
)
my_file
.
write
(
"next_content"
)
my_file
.
close
()
...
...
@@ -466,9 +469,10 @@ shared = true
self
.
updateNodeTestSuiteData
(
node_test_suite
)
rev_list
=
self
.
getAndUpdateFullRevisionList
(
test_node
,
node_test_suite
)
self
.
assertTrue
(
rev_list
is
not
None
)
rep0_clone_path
=
[
x
[
'repository_path'
]
for
x
in
\
node_test_suite
.
vcs_repository_list
\
if
x
[
'repository_path'
].
endswith
(
"rep0"
)][
0
]
rep0_clone_path
=
next
(
x
[
'repository_path'
]
for
x
in
node_test_suite
.
vcs_repository_list
if
x
[
'repository_path'
].
endswith
(
"rep0"
))
# simulate a data corruption on rep0's index
with
open
(
os
.
path
.
join
(
rep0_clone_path
,
'.git'
,
'index'
),
'wb'
)
as
index_file
:
index_file
.
write
(
...
...
@@ -499,9 +503,10 @@ shared = true
rev_list
=
self
.
getAndUpdateFullRevisionList
(
test_node
,
node_test_suite
)
self
.
assertEqual
(
3
,
len
(
rev_list
))
self
.
assertEqual
(
3
,
len
(
node_test_suite
.
vcs_repository_list
))
rep2_remote_path
=
[
x
[
'url'
]
for
x
in
\
node_test_suite
.
vcs_repository_list
\
if
x
[
'url'
].
endswith
(
"rep2"
)][
0
]
rep2_remote_path
=
next
(
x
[
'url'
]
for
x
in
node_test_suite
.
vcs_repository_list
if
x
[
'url'
].
endswith
(
"rep2"
))
call
=
self
.
getCaller
(
cwd
=
rep2_remote_path
)
# make a branch and merge it, to have a topology like this:
...
...
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