Commit c705a653 authored by Federico Vaga's avatar Federico Vaga

tst: remove SCPI usage - keep class

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 83bc07de
......@@ -101,18 +101,10 @@ class FmcFineDelay(PulseGenerator):
@pytest.fixture(scope="module")
def fmcfd():
if pytest.fd_id is not None:
gen = FmcFineDelay(pytest.fd_id)
elif pytest.scpi is not None:
gen = SCPI(pytest.scpi)
gen = FmcFineDelay(pytest.fd_id)
yield gen
if isinstance(gen, FmcFineDelay):
for ch in range(FmcFineDelay.CHANNEL_NUMBER):
gen.disable(ch + 1)
elif isinstance(gen, SCPI):
gen.disable(0)
for ch in range(FmcFineDelay.CHANNEL_NUMBER):
gen.disable(ch + 1)
@pytest.fixture(scope="function")
def fmctdc():
......@@ -129,8 +121,6 @@ def pytest_addoption(parser):
required=True, help="Fmc TDC Linux Identifier")
parser.addoption("--fd-id", type=lambda x : int(x, 16), default=None,
help="Fmc Fine-Delay Linux Identifier")
parser.addoption("--scpi", type=str, default=None,
help="SCPI Connection String")
parser.addoption("--dump-range", type=int, default=10,
help="Timestamps to show before and after an error")
parser.addoption("--channel", type=int, default=[],
......@@ -143,16 +133,22 @@ def pytest_addoption(parser):
def pytest_configure(config):
pytest.tdc_id = config.getoption("--tdc-id")
if len(pytest.tdc_id) == 0:
print("Missing argument --tdc-id")
raise Exception()
pytest.fd_id = config.getoption("--fd-id")
pytest.scpi = config.getoption("--scpi")
if pytest.scpi is None and pytest.fd_id is None:
raise Exception("You must set --fd-id or --scpi")
if len(pytest.tdc_id) == 0:
print("Missing argument --fd-id")
raise Exception()
if len(pytest.tdc_id) != len(pytest.fd_id):
print("For each --fd-id there must be a --tdc-id")
raise Exception()
pytest.fd_tdc_id = zip(pytest.fd_id, pytest.tdc_id)
pytest.channels = config.getoption("--channel")
if len(pytest.channels) == 0:
pytest.channels = range(FmcTdc.CHANNEL_NUMBER)
if len(pytest.channels) != 1 and pytest.scpi is not None:
raise Exception("With --scpi we can test only the channel connected to the Waveform generator. Set --channel")
pytest.usr_acq = (config.getoption("--usr-acq-period-ns"),
config.getoption("--usr-acq-count"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment