Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin-telecom
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
Paul Graydon
wendelin-telecom
Commits
449f5994
Commit
449f5994
authored
Jan 24, 2025
by
Paul Graydon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wendelin_telecom_test: Test additional cases for ORS Data Supply scripts
parent
683079e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
7 deletions
+42
-7
bt5/wendelin_telecom_test/TestTemplateItem/portal_components/test.erp5.testWendelinTelecom.py
...teItem/portal_components/test.erp5.testWendelinTelecom.py
+42
-7
No files found.
bt5/wendelin_telecom_test/TestTemplateItem/portal_components/test.erp5.testWendelinTelecom.py
View file @
449f5994
...
...
@@ -104,6 +104,13 @@ class WendelinTelecomTest(SecurityTestCase):
module
.
manage_delObjects
(
ids
=
test_object_id_list
)
self
.
tic
()
def
_removeDocument
(
self
,
document_to_remove
):
path
=
document_to_remove
.
getRelativeUrl
()
container
,
_
,
object_id
=
path
.
rpartition
(
'/'
)
parent
=
self
.
portal
.
unrestrictedTraverse
(
container
)
parent
.
manage_delObjects
([
object_id
])
self
.
commit
()
def
createWendelinTelecomUser
(
self
,
reference
,
project
,
function
):
# Create and validate a new Person with an assignment
# linked to the provided project and function
...
...
@@ -629,6 +636,9 @@ class WendelinTelecomTest(SecurityTestCase):
'''
Test the action which creates an ORS Data Supply from a Data Acquisition Unit.
Check that the Data Supply is indeed created and validated.
Also check pathological cases considered by the script:
- Data Acquisition Unit has no reference
- Several Data Supplies exist for a Data Acquisition Unit.
'''
reference
=
'test_%s'
%
generateRandomString
()
...
...
@@ -652,7 +662,32 @@ class WendelinTelecomTest(SecurityTestCase):
retrieved_data_supply
=
data_acquisition_unit
.
DataAcquisitionUnit_createOrsDataSupply
(
batch
=
1
)
# Check that both Data Supplies are identical
self
.
assertTrue
(
created_data_supply
==
retrieved_data_supply
)
self
.
assertTrue
(
retrieved_data_supply
==
created_data_supply
)
# Pathological case: create another identical Data Supply
created_data_supply
.
invalidate
()
self
.
tic
()
data_acquisition_unit
.
DataAcquisitionUnit_createOrsDataSupply
(
batch
=
1
)
created_data_supply
.
validate
()
self
.
tic
()
re_retrieved_data_supply
=
data_acquisition_unit
.
DataAcquisitionUnit_createOrsDataSupply
(
batch
=
1
)
self
.
assertTrue
(
re_retrieved_data_supply
==
created_data_supply
)
# Pathological case: create a Data Acquisition Unit without a reference
data_acquisition_unit
=
self
.
portal
.
data_acquisition_unit_module
.
newContent
(
portal_type
=
'Data Acquisition Unit'
,
)
data_acquisition_unit
.
validate
()
self
.
tic
()
self
.
addCleanup
(
self
.
_removeDocument
,
data_acquisition_unit
)
# Call the script which should NOT create a Data Supply (no reference to copy over)
none_data_supply
=
data_acquisition_unit
.
DataAcquisitionUnit_createOrsDataSupply
(
batch
=
1
)
self
.
tic
()
self
.
assertTrue
(
none_data_supply
is
None
)
def
test_02_registerOrsClientProject
(
self
):
'''
...
...
@@ -1260,7 +1295,7 @@ class WendelinTelecomTest(SecurityTestCase):
# except for the last three
ingestion_item_dict_list
=
[
self
.
getOrsLogIngestionItems
(
self
.
test_ors_example_log_
valid
,
self
.
test_ors_example_log_
empty
,
ors_item_dict
[
'data_acquisition_unit'
].
getReference
()
)
for
ors_item_dict
in
ors_item_dict_list
[:
7
]
...
...
@@ -1617,7 +1652,7 @@ class WendelinTelecomTest(SecurityTestCase):
# except for the last one
ingestion_item_dict_list
=
[
self
.
getOrsLogIngestionItems
(
self
.
test_ors_example_log_
valid
,
self
.
test_ors_example_log_
empty
,
ors_item_dict
[
'data_acquisition_unit'
].
getReference
()
)
for
ors_item_dict
in
ors_item_dict_list
[:
-
1
]
...
...
@@ -1942,7 +1977,7 @@ class WendelinTelecomTest(SecurityTestCase):
# Perform a data ingestion for each ORS
ingestion_item_dict_list
=
[
self
.
getOrsLogIngestionItems
(
self
.
test_ors_example_log_
valid
,
self
.
test_ors_example_log_
empty
,
ors_item_dict
[
'data_acquisition_unit'
].
getReference
()
)
for
ors_item_dict
in
ors_item_dict_list
...
...
@@ -2068,15 +2103,15 @@ class WendelinTelecomTest(SecurityTestCase):
# Perform ingestions for all three ORSs
ingestion_a_item_dict
=
self
.
getOrsLogIngestionItems
(
self
.
test_ors_example_log_
valid
,
self
.
test_ors_example_log_
empty
,
ors_a_tag
)
ingestion_b_item_dict
=
self
.
getOrsLogIngestionItems
(
self
.
test_ors_example_log_
valid
,
self
.
test_ors_example_log_
empty
,
ors_b_tag
)
ingestion_n_item_dict
=
self
.
getOrsLogIngestionItems
(
self
.
test_ors_example_log_
valid
,
self
.
test_ors_example_log_
empty
,
ors_n_tag
)
...
...
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