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
9149c7d1
Commit
9149c7d1
authored
5 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Revert unrelated changes
parent
46c8ca39
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!27
Refactor offline I/O
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_daq.py
+14
-8
14 additions, 8 deletions
tests/test_daq.py
with
14 additions
and
8 deletions
tests/test_daq.py
+
14
−
8
View file @
9149c7d1
...
...
@@ -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
=
DAQ_FILE
.
events
self
.
events
=
DAQReader
(
os
.
path
.
join
(
SAMPLES_DIR
,
"
daq_v1.0.0.root
"
)).
events
def
test_index_lookup
(
self
):
assert
3
==
len
(
self
.
events
)
...
...
@@ -24,7 +24,8 @@ class TestDAQEvents(unittest.TestCase):
class
TestDAQEvent
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
event
=
DAQ_FILE
.
events
[
0
]
self
.
event
=
DAQReader
(
os
.
path
.
join
(
SAMPLES_DIR
,
"
daq_v1.0.0.root
"
)).
events
[
0
]
def
test_str
(
self
):
assert
re
.
match
(
"
.*event.*96.*snapshot.*18.*triggered
"
,
...
...
@@ -37,7 +38,8 @@ class TestDAQEvent(unittest.TestCase):
class
TestDAQEventsSnapshotHits
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
events
=
DAQ_FILE
.
events
self
.
events
=
DAQReader
(
os
.
path
.
join
(
SAMPLES_DIR
,
"
daq_v1.0.0.root
"
)).
events
self
.
lengths
=
{
0
:
96
,
1
:
124
,
-
1
:
78
}
self
.
total_item_count
=
298
...
...
@@ -75,7 +77,8 @@ class TestDAQEventsSnapshotHits(unittest.TestCase):
class
TestDAQEventsTriggeredHits
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
events
=
DAQ_FILE
.
events
self
.
events
=
DAQReader
(
os
.
path
.
join
(
SAMPLES_DIR
,
"
daq_v1.0.0.root
"
)).
events
self
.
lengths
=
{
0
:
18
,
1
:
53
,
-
1
:
9
}
self
.
total_item_count
=
80
...
...
@@ -115,7 +118,8 @@ class TestDAQEventsTriggeredHits(unittest.TestCase):
class
TestDAQTimeslices
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
ts
=
DAQ_FILE
.
timeslices
self
.
ts
=
DAQReader
(
os
.
path
.
join
(
SAMPLES_DIR
,
"
daq_v1.0.0.root
"
)).
timeslices
def
test_data_lengths
(
self
):
assert
3
==
len
(
self
.
ts
.
_timeslices
[
"
L1
"
][
0
])
...
...
@@ -140,7 +144,8 @@ class TestDAQTimeslices(unittest.TestCase):
class
TestDAQTimeslice
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
ts
=
DAQ_FILE
.
timeslices
self
.
ts
=
DAQReader
(
os
.
path
.
join
(
SAMPLES_DIR
,
"
daq_v1.0.0.root
"
)).
timeslices
self
.
n_frames
=
{
"
L1
"
:
[
69
,
69
,
69
],
"
SN
"
:
[
64
,
66
,
68
]}
def
test_str
(
self
):
...
...
@@ -153,7 +158,8 @@ class TestDAQTimeslice(unittest.TestCase):
class
TestSummaryslices
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
ss
=
DAQ_FILE
.
summaryslices
self
.
ss
=
DAQReader
(
os
.
path
.
join
(
SAMPLES_DIR
,
"
daq_v1.0.0.root
"
)).
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