Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gaudi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaudi
Gaudi
Commits
c2eadc26
Commit
c2eadc26
authored
1 year ago
by
Marco Clemencic
Browse files
Options
Downloads
Plain Diff
GaudiConfig2: fix comparison of sequence properties
Closes
#264
See merge request
!1445
parents
b110a38c
16292c99
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1445
GaudiConfig2: fix comparison of sequence properties
Pipeline
#5470937
canceled
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GaudiConfiguration/python/GaudiConfig2/semantics.py
+2
-5
2 additions, 5 deletions
GaudiConfiguration/python/GaudiConfig2/semantics.py
GaudiConfiguration/tests/nose/test_sequence_semantics.py
+19
-10
19 additions, 10 deletions
GaudiConfiguration/tests/nose/test_sequence_semantics.py
with
21 additions
and
15 deletions
GaudiConfiguration/python/GaudiConfig2/semantics.py
+
2
−
5
View file @
c2eadc26
#####################################################################################
# (c) Copyright 1998-202
2
CERN for the benefit of the LHCb and ATLAS collaborations #
# (c) Copyright 1998-202
3
CERN for the benefit of the LHCb and ATLAS collaborations #
# #
# This software is distributed under the terms of the Apache version 2 licence, #
# copied verbatim in the file "LICENSE". #
...
...
@@ -322,10 +322,7 @@ class _ListHelper(MutableSequence):
self
.
data
.
__delitem__
(
key
)
def
__eq__
(
self
,
other
):
return
self
.
data
==
other
.
data
def
__ne__
(
self
,
other
):
return
self
.
data
!=
other
.
data
return
self
.
data
==
other
def
insert
(
self
,
key
,
value
):
self
.
is_dirty
=
True
...
...
This diff is collapsed.
Click to expand it.
GaudiConfiguration/tests/nose/test_sequence_semantics.py
+
19
−
10
View file @
c2eadc26
#####################################################################################
# (c) Copyright 1998-20
19
CERN for the benefit of the LHCb and ATLAS collaborations #
# (c) Copyright 1998-20
23
CERN for the benefit of the LHCb and ATLAS collaborations #
# #
# This software is distributed under the terms of the Apache version 2 licence, #
# copied verbatim in the file "LICENSE". #
...
...
@@ -34,7 +34,7 @@ def test_default():
d
=
s
.
default
([
"
a
"
,
"
b
"
,
"
c
"
])
assert
not
d
.
is_dirty
assert
len
(
d
)
==
3
assert
list
(
d
)
==
list
(
"
abc
"
)
assert
d
==
list
(
"
abc
"
)
@raises
(
RuntimeError
)
...
...
@@ -45,24 +45,33 @@ def test_default_read_only():
del
d
[
1
]
def
test_comparison
():
s
=
S
.
getSemanticsFor
(
"
std::vector<int>
"
)
d1
=
s
.
store
([
1
,
2
])
d2
=
s
.
store
([
1
,
2
])
assert
d1
==
[
1
,
2
]
assert
d1
==
d2
assert
d1
!=
[]
def
test_changes
():
s
=
S
.
getSemanticsFor
(
"
std::vector<std::string, alloc<string> >
"
)
d
=
s
.
store
([
"
a
"
,
"
b
"
,
"
c
"
])
assert
d
.
is_dirty
assert
list
(
d
)
==
list
(
"
abc
"
)
assert
d
==
list
(
"
abc
"
)
d
[
2
]
=
"
z
"
assert
list
(
d
)
==
list
(
"
abz
"
)
assert
d
==
list
(
"
abz
"
)
d
.
append
(
"
1
"
)
assert
list
(
d
)
==
list
(
"
abz1
"
)
assert
d
==
list
(
"
abz1
"
)
d
.
insert
(
1
,
"
_
"
)
assert
list
(
d
)
==
list
(
"
a_bz1
"
)
assert
d
==
list
(
"
a_bz1
"
)
assert
len
(
d
)
==
5
del
d
[
2
]
assert
list
(
d
)
==
list
(
"
a_z1
"
)
assert
d
==
list
(
"
a_z1
"
)
def
test_opt_value
():
...
...
@@ -83,7 +92,7 @@ def test_assignment_bad():
def
test_in_alg
():
p
=
AlgWithVectors
()
assert
list
(
p
.
VS
)
==
[]
assert
p
.
VS
==
[]
p
.
VS
=
[
"
a
"
,
"
z
"
]
assert
len
(
p
.
VS
)
==
2
...
...
@@ -99,11 +108,11 @@ def test_nested_vector():
assert
isinstance
(
d
[
0
],
S
.
_ListHelper
)
assert
d
[
0
].
is_dirty
assert
list
(
d
[
0
]
)
==
list
(
"
ab
"
)
assert
d
[
0
]
==
list
(
"
ab
"
)
assert
isinstance
(
d
[
1
],
S
.
_ListHelper
)
assert
d
[
1
].
is_dirty
assert
list
(
d
[
1
]
)
==
list
(
"
cde
"
)
assert
d
[
1
]
==
list
(
"
cde
"
)
@raises
(
ValueError
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment