removed c++14 only overload_cast from pybind enum interface

This commit is contained in:
Erik Frojdh
2021-11-05 11:56:57 +01:00
parent 5f94ca30f1
commit 642989cab2
3 changed files with 84 additions and 33 deletions

View File

@ -0,0 +1,23 @@
from slsdet.enums import streamingInterface
import pytest
def test_streamingInterface_bitwise():
"""Bitwise operations on streaming interfaces are allowed"""
sif_none = streamingInterface.NONE
sif_low = streamingInterface.LOW_LATENCY_LINK
sif_10g = streamingInterface.ETHERNET_10GB
sif_all = streamingInterface.ALL
assert sif_low | sif_none == sif_low
assert sif_10g | sif_none == sif_10g
assert sif_low | sif_10g == sif_all
assert sif_10g | sif_all == sif_all
assert sif_10g & sif_low == sif_none
assert sif_low & sif_low == sif_low
assert sif_all & sif_all == sif_all
def test_streamingInterface_bitwise_only_allowed_on_same_type():
with pytest.raises(Exception):
assert streamingInterface.LOW_LATENCY_LINK & 5 == 7