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, ):
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
):
...
...
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.py
View file @
269c886d
...
...
@@ -49,11 +49,11 @@ if getZopeVersion() < (4, ): # BBB Zope2
def
getRandomString
():
return
'test_%s'
%
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
for
_
in
x
range
(
32
)])
for
_
in
range
(
32
)])
def
chunks
(
l
,
n
):
"""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
]
class
Test
(
ERP5TypeTestCase
):
...
...
@@ -275,7 +275,7 @@ class Test(ERP5TypeTestCase):
bucket_stream
.
insertBucket
(
i
,
i
*
10000
)
self
.
assertEqual
(
100
,
len
(
bucket_stream
))
self
.
assertEqual
(
range
(
100
),
bucket_stream
.
getKeyList
())
self
.
assertEqual
(
list
(
range
(
100
)
),
bucket_stream
.
getKeyList
())
# test as sequence
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):
self
.
assertEqual
(
self
.
PART_1
,
self
.
REFERENCE_SEPARATOR
+
self
.
portal
.
ERP5Site_getIngestionReferenceDictionary
()[
"split_first_suffix"
])
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
def
getIngestionReference
(
self
,
reference
,
extension
,
randomize_ingestion_reference
=
False
,
data_set_reference
=
False
):
...
...
@@ -58,7 +58,7 @@ class TestDataIngestion(SecurityTestCase):
return
self
.
REF_SUPPLIER_PREFIX
+
ingestion_reference
+
self
.
REFERENCE_SEPARATOR
+
self
.
REFERENCE_SEPARATOR
+
str
(
""
)
+
self
.
REFERENCE_SEPARATOR
+
""
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
]
def
getDataIngestion
(
self
,
reference
):
...
...
@@ -154,13 +154,13 @@ class TestDataIngestion(SecurityTestCase):
chunks).
"""
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
)
\
for
_
in
x
range
(
250
)])
for
_
in
range
(
250
)])
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
)
\
for
_
in
x
range
(
250
)])
for
_
in
range
(
250
)])
reference
=
self
.
getRandomReference
()
...
...
bt5/erp5_wendelin_examples/ExtensionTemplateItem/portal_components/extension.erp5.WendelinExamples.py
View file @
269c886d
...
...
@@ -11,7 +11,7 @@ import string
def
getRandomString
():
return
'test_%s'
%
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
for
_
in
x
range
(
32
)])
for
_
in
range
(
32
)])
# Game of Life examples
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
numpy
as
np
import
re
from
six.moves
import
range
import
transaction
from
DateTime
import
DateTime
from
wendelin.bigarray.array_zodb
import
ZBigArray
...
...
@@ -58,7 +59,7 @@ class ZBigArrayConverter(object):
data_array
=
result
[
0
]
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
# `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
...
...
@@ -179,7 +180,7 @@ class ZBigArrayExtender(object):
extension_dtype
=
DtypeIdentifier
(
self
.
extension
).
identify
()
if
not
self
.
source
.
dtype
==
extension_dtype
:
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
# when we convert it to an array.
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:
"error_message"
:
"Parameter 'user_quantity' is required."
,
"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
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:
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
person
=
portal_catalog
.
getResultValue
(
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