Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Commit

Permalink
Merge pull request #35 from cta-sst-1m/tidy_up_tests_more_tests
Browse files Browse the repository at this point in the history
Tidy up tests more tests
  • Loading branch information
Dominik Neise authored May 12, 2018
2 parents c6f5620 + 18bbbf8 commit 9b64c50
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions protozfits/tests/test_R1_example_file.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

import numpy as np
import pkg_resources
import os

from protozfits import SimpleFile

example_file_path = pkg_resources.resource_filename(
'protozfits',
os.path.join(
Expand All @@ -13,20 +14,16 @@
)


def test_can_open_file():
from protozfits import SimpleFile
SimpleFile(example_file_path)


def test_can_iterate_over_events_and_run_header():
from protozfits import SimpleFile
f = SimpleFile(example_file_path)

camera_config = next(f.CameraConfig)
assert (camera_config.expected_pixels_id == np.arange(14)).all()
with SimpleFile(example_file_path) as f:

camera_config = next(f.CameraConfig)
assert (camera_config.expected_pixels_id == np.arange(14)).all()

for event in f.Events:
assert event.waveform.shape == (1120,)
assert event.pixel_status.shape == (14,)
assert event.lstcam.first_capacitor_id.shape == (16,)
assert event.lstcam.counters.shape == (44,)
for i, event in enumerate(f.Events):
assert event.event_id == i + 1
assert event.waveform.shape == (1120,)
assert event.pixel_status.shape == (14,)
assert event.lstcam.first_capacitor_id.shape == (16,)
assert event.lstcam.counters.shape == (44,)

0 comments on commit 9b64c50

Please sign in to comment.