Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
km3io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
km3py
km3io
Commits
e8f09280
Commit
e8f09280
authored
5 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Improve test performance
parent
9f774235
No related branches found
No related tags found
1 merge request
!23
Improve test performance
Pipeline
#9710
passed
5 years ago
Stage: test
Stage: coverage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_daq.py
+8
-14
8 additions, 14 deletions
tests/test_daq.py
with
8 additions
and
14 deletions
tests/test_daq.py
+
8
−
14
View file @
e8f09280
...
...
@@ -5,12 +5,12 @@ import unittest
from
km3io.daq
import
DAQReader
,
get_rate
,
has_udp_trailer
,
get_udp_max_sequence_number
,
get_channel_flags
,
get_number_udp_packets
SAMPLES_DIR
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
samples
"
)
DAQ_FILE
=
DAQReader
(
os
.
path
.
join
(
SAMPLES_DIR
,
"
daq_v1.0.0.root
"
))
class
TestDAQEvents
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
events
=
DAQReader
(
os
.
path
.
join
(
SAMPLES_DIR
,
"
daq_v1.0.0.root
"
)).
events
self
.
events
=
DAQ_FILE
.
events
def
test_index_lookup
(
self
):
assert
3
==
len
(
self
.
events
)
...
...
@@ -24,8 +24,7 @@ class TestDAQEvents(unittest.TestCase):
class
TestDAQEvent
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
event
=
DAQReader
(
os
.
path
.
join
(
SAMPLES_DIR
,
"
daq_v1.0.0.root
"
)).
events
[
0
]
self
.
event
=
DAQ_FILE
.
events
[
0
]
def
test_str
(
self
):
assert
re
.
match
(
"
.*event.*96.*snapshot.*18.*triggered
"
,
...
...
@@ -38,8 +37,7 @@ class TestDAQEvent(unittest.TestCase):
class
TestDAQEventsSnapshotHits
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
events
=
DAQReader
(
os
.
path
.
join
(
SAMPLES_DIR
,
"
daq_v1.0.0.root
"
)).
events
self
.
events
=
DAQ_FILE
.
events
self
.
lengths
=
{
0
:
96
,
1
:
124
,
-
1
:
78
}
self
.
total_item_count
=
298
...
...
@@ -77,8 +75,7 @@ class TestDAQEventsSnapshotHits(unittest.TestCase):
class
TestDAQEventsTriggeredHits
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
events
=
DAQReader
(
os
.
path
.
join
(
SAMPLES_DIR
,
"
daq_v1.0.0.root
"
)).
events
self
.
events
=
DAQ_FILE
.
events
self
.
lengths
=
{
0
:
18
,
1
:
53
,
-
1
:
9
}
self
.
total_item_count
=
80
...
...
@@ -118,8 +115,7 @@ class TestDAQEventsTriggeredHits(unittest.TestCase):
class
TestDAQTimeslices
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
ts
=
DAQReader
(
os
.
path
.
join
(
SAMPLES_DIR
,
"
daq_v1.0.0.root
"
)).
timeslices
self
.
ts
=
DAQ_FILE
.
timeslices
def
test_data_lengths
(
self
):
assert
3
==
len
(
self
.
ts
.
_timeslices
[
"
L1
"
][
0
])
...
...
@@ -144,8 +140,7 @@ class TestDAQTimeslices(unittest.TestCase):
class
TestDAQTimeslice
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
ts
=
DAQReader
(
os
.
path
.
join
(
SAMPLES_DIR
,
"
daq_v1.0.0.root
"
)).
timeslices
self
.
ts
=
DAQ_FILE
.
timeslices
self
.
n_frames
=
{
"
L1
"
:
[
69
,
69
,
69
],
"
SN
"
:
[
64
,
66
,
68
]}
def
test_str
(
self
):
...
...
@@ -158,8 +153,7 @@ class TestDAQTimeslice(unittest.TestCase):
class
TestSummaryslices
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
ss
=
DAQReader
(
os
.
path
.
join
(
SAMPLES_DIR
,
"
daq_v1.0.0.root
"
)).
summaryslices
self
.
ss
=
DAQ_FILE
.
summaryslices
def
test_headers
(
self
):
assert
3
==
len
(
self
.
ss
.
headers
)
...
...
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