"""Integration tests for the generic EXAFS processor."""

from .. import testing
from ..processors.exafs import DemoExafsProcessor
from .utils import exafs


def exafs_demo(nrepeats: int = None, fast: bool = True):
    test_exafs_scan(nrepeats=nrepeats, fast=fast)


@testing.integration_fixture
def exafs_processor():
    return DemoExafsProcessor()


@testing.integration_test
def test_exafs_scan(exafs_processor, nrepeats: int = None, fast: bool = True):
    if nrepeats is None:
        nrepeats = exafs_processor.max_scans + 1
    exafs_processor.clear()
    for _ in range(nrepeats):
        exafs.test_exafs_scan(exafs_processor, fast=fast, split=True)
