Skip to content

Commit

Permalink
add check on file size
Browse files Browse the repository at this point in the history
  • Loading branch information
HealthyPear committed Mar 10, 2021
1 parent 19b8956 commit d864ddd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions protopipe/scripts/tests/test_dataTraining.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from os import path, system
from pkg_resources import resource_filename

import tables
import pytest

from protopipe.scripts import data_training
Expand Down Expand Up @@ -48,8 +49,14 @@ def test_dataTraining_noImages(input_file):
-i {path.dirname(input_file)}\
-f {path.basename(input_file)}"
)

# check that the script ends without crashing
assert exit_status == 0

# check that the produced HDF5 file is non-empty
with tables.open_file("test_training_noImages.h5") as file:
assert file.get_filesize() > 0


@pytest.mark.parametrize("input_file", [PROD3B_CTA_NORTH, PROD3B_CTA_SOUTH])
def test_dataTraining_withImages(input_file):
Expand All @@ -76,4 +83,10 @@ def test_dataTraining_withImages(input_file):
-i {path.dirname(input_file)}\
-f {path.basename(input_file)}"
)

# check that the script ends without crashing
assert exit_status == 0

# check that the produced HDF5 file is non-empty
with tables.open_file("test_training_noImages.h5") as file:
assert file.get_filesize() > 0

0 comments on commit d864ddd

Please sign in to comment.