Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ABC FlowInterface tests #267

Merged
merged 3 commits into from
Aug 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions tests/test_FlowInterface.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# ===================================================
#
# Copyright (c) 2023-2024
# SPARKX Team
#
# GNU General Public License (GPLv3 or later)
#
# ===================================================

from sparkx.flow.FlowInterface import FlowInterface


class DummyFlow(FlowInterface):
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs

def integrated_flow(self, particle_data, *args, **kwargs):
return "integrated_flow called"

def differential_flow(
self, particle_data, bins, flow_as_function_of, *args, **kwargs
):
return "differential_flow called"


def test_integrated_flow():
flow = DummyFlow()
result = flow.integrated_flow("particle_data")
assert result == "integrated_flow called"


def test_differential_flow():
flow = DummyFlow()
result = flow.differential_flow(
"particle_data", "bins", "flow_as_function_of"
)
assert result == "differential_flow called"
Loading