Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin
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
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
wendelin
Commits
269c886d
Commit
269c886d
authored
Nov 18, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py3: do not use xrange
parent
c07ed743
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
15 deletions
+16
-15
bt5/erp5_mqtt/TestTemplateItem/portal_components/test.erp5.testMQTTMessage.py
...mplateItem/portal_components/test.erp5.testMQTTMessage.py
+1
-1
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.py
...tTemplateItem/portal_components/test.erp5.testWendelin.py
+3
-3
bt5/erp5_wendelin_data_lake_ingestion/TestTemplateItem/portal_components/test.erp5.testDataLakeIngestion.py
...Item/portal_components/test.erp5.testDataLakeIngestion.py
+6
-6
bt5/erp5_wendelin_examples/ExtensionTemplateItem/portal_components/extension.erp5.WendelinExamples.py
...Item/portal_components/extension.erp5.WendelinExamples.py
+1
-1
bt5/erp5_wendelin_inventory/ExtensionTemplateItem/portal_components/extension.erp5.PandasInventory.py
...eItem/portal_components/extension.erp5.PandasInventory.py
+3
-2
bt5/erp5_wendelin_scalability_test/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_test/ERP5Site_bootstrapScalabilityTest.py
...lin_scalability_test/ERP5Site_bootstrapScalabilityTest.py
+1
-1
bt5/erp5_wendelin_scalability_test/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_test/ERP5Site_createTestData.py
...erp5_wendelin_scalability_test/ERP5Site_createTestData.py
+1
-1
No files found.
bt5/erp5_mqtt/TestTemplateItem/portal_components/test.erp5.testMQTTMessage.py
View file @
269c886d
...
@@ -42,7 +42,7 @@ if getZopeVersion() < (4, ):
...
@@ -42,7 +42,7 @@ if getZopeVersion() < (4, ):
def
getRandomString
():
def
getRandomString
():
return
"test.%s"
%
""
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
for
_
in
x
range
(
32
)])
return
"test.%s"
%
""
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
for
_
in
range
(
32
)])
class
TestDataIngestion
(
ERP5TypeTestCase
):
class
TestDataIngestion
(
ERP5TypeTestCase
):
...
...
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.py
View file @
269c886d
...
@@ -49,11 +49,11 @@ if getZopeVersion() < (4, ): # BBB Zope2
...
@@ -49,11 +49,11 @@ if getZopeVersion() < (4, ): # BBB Zope2
def
getRandomString
():
def
getRandomString
():
return
'test_%s'
%
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
return
'test_%s'
%
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
for
_
in
x
range
(
32
)])
for
_
in
range
(
32
)])
def
chunks
(
l
,
n
):
def
chunks
(
l
,
n
):
"""Yield successive n-sized chunks from l."""
"""Yield successive n-sized chunks from l."""
for
i
in
x
range
(
0
,
len
(
l
),
n
):
for
i
in
range
(
0
,
len
(
l
),
n
):
yield
l
[
i
:
i
+
n
]
yield
l
[
i
:
i
+
n
]
class
Test
(
ERP5TypeTestCase
):
class
Test
(
ERP5TypeTestCase
):
...
@@ -275,7 +275,7 @@ class Test(ERP5TypeTestCase):
...
@@ -275,7 +275,7 @@ class Test(ERP5TypeTestCase):
bucket_stream
.
insertBucket
(
i
,
i
*
10000
)
bucket_stream
.
insertBucket
(
i
,
i
*
10000
)
self
.
assertEqual
(
100
,
len
(
bucket_stream
))
self
.
assertEqual
(
100
,
len
(
bucket_stream
))
self
.
assertEqual
(
range
(
100
),
bucket_stream
.
getKeyList
())
self
.
assertEqual
(
list
(
range
(
100
)
),
bucket_stream
.
getKeyList
())
# test as sequence
# test as sequence
bucket
=
bucket_stream
.
getBucketKeyItemSequenceByKey
(
start_key
=
10
,
count
=
1
)[
0
]
bucket
=
bucket_stream
.
getBucketKeyItemSequenceByKey
(
start_key
=
10
,
count
=
1
)[
0
]
...
...
bt5/erp5_wendelin_data_lake_ingestion/TestTemplateItem/portal_components/test.erp5.testDataLakeIngestion.py
View file @
269c886d
...
@@ -34,7 +34,7 @@ class TestDataIngestion(SecurityTestCase):
...
@@ -34,7 +34,7 @@ class TestDataIngestion(SecurityTestCase):
self
.
assertEqual
(
self
.
PART_1
,
self
.
REFERENCE_SEPARATOR
+
self
.
portal
.
ERP5Site_getIngestionReferenceDictionary
()[
"split_first_suffix"
])
self
.
assertEqual
(
self
.
PART_1
,
self
.
REFERENCE_SEPARATOR
+
self
.
portal
.
ERP5Site_getIngestionReferenceDictionary
()[
"split_first_suffix"
])
def
getRandomReference
(
self
):
def
getRandomReference
(
self
):
random_string
=
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
for
_
in
x
range
(
10
)])
random_string
=
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
for
_
in
range
(
10
)])
return
'UNIT-TEST-'
+
random_string
return
'UNIT-TEST-'
+
random_string
def
getIngestionReference
(
self
,
reference
,
extension
,
randomize_ingestion_reference
=
False
,
data_set_reference
=
False
):
def
getIngestionReference
(
self
,
reference
,
extension
,
randomize_ingestion_reference
=
False
,
data_set_reference
=
False
):
...
@@ -58,7 +58,7 @@ class TestDataIngestion(SecurityTestCase):
...
@@ -58,7 +58,7 @@ class TestDataIngestion(SecurityTestCase):
return
self
.
REF_SUPPLIER_PREFIX
+
ingestion_reference
+
self
.
REFERENCE_SEPARATOR
+
self
.
REFERENCE_SEPARATOR
+
str
(
""
)
+
self
.
REFERENCE_SEPARATOR
+
""
return
self
.
REF_SUPPLIER_PREFIX
+
ingestion_reference
+
self
.
REFERENCE_SEPARATOR
+
self
.
REFERENCE_SEPARATOR
+
str
(
""
)
+
self
.
REFERENCE_SEPARATOR
+
""
def
chunks
(
self
,
l
,
n
):
def
chunks
(
self
,
l
,
n
):
for
i
in
x
range
(
0
,
len
(
l
),
n
):
for
i
in
range
(
0
,
len
(
l
),
n
):
yield
l
[
i
:
i
+
n
]
yield
l
[
i
:
i
+
n
]
def
getDataIngestion
(
self
,
reference
):
def
getDataIngestion
(
self
,
reference
):
...
@@ -154,13 +154,13 @@ class TestDataIngestion(SecurityTestCase):
...
@@ -154,13 +154,13 @@ class TestDataIngestion(SecurityTestCase):
chunks).
chunks).
"""
"""
data_chunk_1
=
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
data_chunk_1
=
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
for
_
in
x
range
(
250
)])
for
_
in
range
(
250
)])
data_chunk_2
=
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
data_chunk_2
=
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
for
_
in
x
range
(
250
)])
for
_
in
range
(
250
)])
data_chunk_3
=
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
data_chunk_3
=
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
for
_
in
x
range
(
250
)])
for
_
in
range
(
250
)])
data_chunk_4
=
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
data_chunk_4
=
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
for
_
in
x
range
(
250
)])
for
_
in
range
(
250
)])
reference
=
self
.
getRandomReference
()
reference
=
self
.
getRandomReference
()
...
...
bt5/erp5_wendelin_examples/ExtensionTemplateItem/portal_components/extension.erp5.WendelinExamples.py
View file @
269c886d
...
@@ -11,7 +11,7 @@ import string
...
@@ -11,7 +11,7 @@ import string
def
getRandomString
():
def
getRandomString
():
return
'test_%s'
%
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
return
'test_%s'
%
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
for
_
in
x
range
(
32
)])
for
_
in
range
(
32
)])
# Game of Life examples
# Game of Life examples
default_input_ndarray
=
np
.
array
([[
0
,
0
,
0
,
0
,
0
,
0
],
default_input_ndarray
=
np
.
array
([[
0
,
0
,
0
,
0
,
0
,
0
],
...
...
bt5/erp5_wendelin_inventory/ExtensionTemplateItem/portal_components/extension.erp5.PandasInventory.py
View file @
269c886d
import
pandas
as
pd
import
pandas
as
pd
import
numpy
as
np
import
numpy
as
np
import
re
import
re
from
six.moves
import
range
import
transaction
import
transaction
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
wendelin.bigarray.array_zodb
import
ZBigArray
from
wendelin.bigarray.array_zodb
import
ZBigArray
...
@@ -58,7 +59,7 @@ class ZBigArrayConverter(object):
...
@@ -58,7 +59,7 @@ class ZBigArrayConverter(object):
data_array
=
result
[
0
]
data_array
=
result
[
0
]
array
=
data_array
.
getArray
()
array
=
data_array
.
getArray
()
for
index
in
xrange
(
len
(
array
)):
for
index
in
range
(
len
(
array
)):
# We need to order everything related to the data schema here. The Results methods
# We need to order everything related to the data schema here. The Results methods
# `tuples()`, `names` and `data_dictionary` returns the fields in a different order
# `tuples()`, `names` and `data_dictionary` returns the fields in a different order
# and order is very important in the conversion to a ZBigArray. So we build
# and order is very important in the conversion to a ZBigArray. So we build
...
@@ -179,7 +180,7 @@ class ZBigArrayExtender(object):
...
@@ -179,7 +180,7 @@ class ZBigArrayExtender(object):
extension_dtype
=
DtypeIdentifier
(
self
.
extension
).
identify
()
extension_dtype
=
DtypeIdentifier
(
self
.
extension
).
identify
()
if
not
self
.
source
.
dtype
==
extension_dtype
:
if
not
self
.
source
.
dtype
==
extension_dtype
:
raise
TypeError
(
'Source and extension data types does not match.'
)
raise
TypeError
(
'Source and extension data types does not match.'
)
for
index
in
xrange
(
len
(
self
.
extension
)):
for
index
in
range
(
len
(
self
.
extension
)):
# Basically the same problem here with the order of Results instance fields
# Basically the same problem here with the order of Results instance fields
# when we convert it to an array.
# when we convert it to an array.
ordered_movements
=
[]
ordered_movements
=
[]
...
...
bt5/erp5_wendelin_scalability_test/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_test/ERP5Site_bootstrapScalabilityTest.py
View file @
269c886d
...
@@ -18,7 +18,7 @@ if user_quantity is None:
...
@@ -18,7 +18,7 @@ if user_quantity is None:
"error_message"
:
"Parameter 'user_quantity' is required."
,
"error_message"
:
"Parameter 'user_quantity' is required."
,
"password"
:
None
})
"password"
:
None
})
password
=
''
.
join
(
random
.
choice
(
string
.
digits
+
string
.
letters
)
for
i
in
x
range
(
10
))
password
=
''
.
join
(
random
.
choice
(
string
.
digits
+
string
.
letters
)
for
i
in
range
(
10
))
# check erp5_scalability_test business template is present
# check erp5_scalability_test business template is present
configurator
=
portal
.
business_configuration_module
.
default_wendelin_configuration
configurator
=
portal
.
business_configuration_module
.
default_wendelin_configuration
...
...
bt5/erp5_wendelin_scalability_test/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_test/ERP5Site_createTestData.py
View file @
269c886d
...
@@ -17,7 +17,7 @@ try:
...
@@ -17,7 +17,7 @@ try:
organisation
=
organisation
.
getRelativeUrl
()
organisation
=
organisation
.
getRelativeUrl
()
for
i
in
x
range
(
0
,
int
(
user_quantity
)):
for
i
in
range
(
0
,
int
(
user_quantity
)):
user_id
=
"scalability_user_%i"
%
i
user_id
=
"scalability_user_%i"
%
i
person
=
portal_catalog
.
getResultValue
(
person
=
portal_catalog
.
getResultValue
(
portal_type
=
"Person"
,
portal_type
=
"Person"
,
...
...
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