From bd3ebd90c2bcbd5eddd9175afc9157b0b32312fa Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 26 Feb 2021 07:42:39 -0600 Subject: [PATCH] Add test for wrong source attributes --- tests/unit_tests/test_source_file.py | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/unit_tests/test_source_file.py b/tests/unit_tests/test_source_file.py index ae6eff97f..70aa1be4d 100644 --- a/tests/unit_tests/test_source_file.py +++ b/tests/unit_tests/test_source_file.py @@ -1,4 +1,5 @@ from random import random +import subprocess import h5py import numpy as np @@ -43,3 +44,35 @@ def test_source_file(run_in_tmpdir): assert np.all(arr['wgt'] == 1.0) assert np.all(arr['delayed_group'] == 0) assert np.all(arr['particle'] == 0) + + +def test_wrong_source_attributes(run_in_tmpdir): + # Create a source file with animal attributes + source_dtype = np.dtype([ + ('platypus', '