Skip to content

Commit

Permalink
A few more test coverage improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwatts committed Sep 14, 2021
1 parent ef46c2e commit 7c56595
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
1 change: 0 additions & 1 deletion func_adl_xAOD/common/event_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,3 @@ def get_running_code(self, container_type: event_collection_container) -> List[s
Returns:
List[str]: Lines of C++ code to execute to get this out.
'''
pass
22 changes: 22 additions & 0 deletions tests/atlas/xaod/test_xaod_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,3 +653,25 @@ def test_metadata_collection_bad_experiment():
.value())

assert "backend; only" in str(e.value)


def test_event_collection_too_many_arg():
'This is integration testing - making sure the dict to root conversion works'
with pytest.raises(ValueError) as e:
(atlas_xaod_dataset()
.Select(lambda e: e.EventInfo("EventInfo", "dork").runNumber())
.Select(lambda e: {'run_number': e})
.value())

assert "only one argument" in str(e)


def test_event_collection_bad_type_arg():
'This is integration testing - making sure the dict to root conversion works'
with pytest.raises(ValueError) as e:
(atlas_xaod_dataset()
.Select(lambda e: e.EventInfo(2).runNumber())
.Select(lambda e: {'run_number': e})
.value())

assert "is a string" in str(e)

0 comments on commit 7c56595

Please sign in to comment.