Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
seda
Commits
56b3e27c5127
Commit
7f3e866e
authored
Oct 02, 2019
by
Denis Laxalde
Browse files
[py3] Modernize
parent
d496f4739032
Changes
3
Hide whitespace changes
Inline
Side-by-side
cubicweb_seda/migration/0.11.0_Any.py
View file @
56b3e27c
...
...
@@ -6,7 +6,7 @@ from cubicweb_seda.dataimport import LCSV_FILES, import_seda_schemes
# uri. Should be done there but still easier here.
try
:
from
cubicweb_saem_ref.site_cubicweb
import
init_seda_scheme
init_seda_scheme
.
func
_defaults
[
0
][
0
]
=
len
(
LCSV_FILES
)
-
1
init_seda_scheme
.
_
_defaults
__
[
0
][
0
]
=
len
(
LCSV_FILES
)
-
1
except
ImportError
:
pass
...
...
test/test_profile_generation.py
View file @
56b3e27c
...
...
@@ -20,12 +20,13 @@ writing of generated content back to the file-system.
"""
from
doctest
import
Example
from
itertools
import
chain
,
izip
,
repeat
from
itertools
import
chain
,
repeat
import
os
from
os.path
import
basename
,
join
import
unittest
from
six
import
binary_type
,
text_type
from
six.moves
import
zip
from
lxml
import
etree
from
lxml.doctestcompare
import
LXMLOutputChecker
...
...
@@ -191,8 +192,8 @@ class RelaxNGTestMixin(XmlTestMixin):
adefs
=
[]
optattrs
=
self
.
xpath
(
element
,
'rng:optional/rng:attribute'
)
attrs
=
self
.
xpath
(
element
,
'rng:attribute'
)
for
use
,
adef_element
in
chain
(
i
zip
(
repeat
(
'optional'
),
optattrs
),
i
zip
(
repeat
(
'required'
),
attrs
)):
for
use
,
adef_element
in
chain
(
zip
(
repeat
(
'optional'
),
optattrs
),
zip
(
repeat
(
'required'
),
attrs
)):
adef
=
dict
(
adef_element
.
attrib
)
adef
[
'use'
]
=
use
data_elements
=
self
.
xpath
(
adef_element
,
'rng:data'
)
...
...
test/test_views.py
View file @
56b3e27c
...
...
@@ -19,6 +19,7 @@ from json import dumps
import
unittest
from
six
import
text_type
from
six.moves
import
zip
from
cubicweb.devtools.testlib
import
CubicWebTC
from
cubicweb.web
import
INTERNAL_FIELD_VALUE
...
...
@@ -515,9 +516,9 @@ class CloneImportTC(CubicWebTC):
{
'p'
:
eid
})
self
.
assertEqual
(
len
(
rset
),
2
)
self
.
assertCountEqual
([
oeid
for
__
,
oeid
in
rset
.
rows
],
to_clone
)
cardinalities
,
annotations
=
zip
(
*
[
cardinalities
,
annotations
=
list
(
zip
(
*
[
(
clone
.
user_cardinality
,
clone
.
user_annotation
)
for
clone
in
rset
.
entities
()])
for
clone
in
rset
.
entities
()])
)
self
.
assertCountEqual
(
cardinalities
,
(
'1'
,
'0..1'
))
self
.
assertCountEqual
(
annotations
,
(
'plop'
,
'plouf'
))
...
...
Write
Preview
Supports
Markdown
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