from ...bliss_globals import setup_globals
from .. import testing
from ..processors.id32 import DemoId32pecGenPProcessor


@testing.integration_fixture
def id32_specgen_processor():
    processor = DemoId32pecGenPProcessor()
    processor.enable()
    yield processor
    processor.disable()


def id32_specgen_demo(expo=0.2, npoints=10):
    itest_id32(expo=expo, npoints=npoints)


@testing.integration_test
def itest_id32(id32_specgen_processor, expo=0.2, npoints=10):
    print("The workflow is expected to fail so this only tests the triggering for now.")
    setup_globals.loopscan(npoints, expo, setup_globals.difflab6)
    testing.wait_workflows()
