Skip to content

Commit

Permalink
DELETE ME: debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
evalott100 committed Nov 28, 2024
1 parent ad985e7 commit bdeb30a
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 1,892 deletions.
Empty file removed tests/sim/__init__.py
Empty file.
11 changes: 0 additions & 11 deletions tests/sim/conftest.py

This file was deleted.

Empty file removed tests/sim/demo/__init__.py
Empty file.
56 changes: 0 additions & 56 deletions tests/sim/demo/test_sim_motor.py

This file was deleted.

34 changes: 0 additions & 34 deletions tests/sim/test_pattern_generator.py

This file was deleted.

53 changes: 0 additions & 53 deletions tests/sim/test_sim_detector.py

This file was deleted.

42 changes: 0 additions & 42 deletions tests/sim/test_sim_writer.py

This file was deleted.

55 changes: 0 additions & 55 deletions tests/sim/test_streaming_plan.py

This file was deleted.

36 changes: 23 additions & 13 deletions tests/tango/test_base_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@
AttrQuality,
AttrWriteType,
CmdArgType,
GreenMode,
DevState,
)
from tango.asyncio import DeviceProxy as AsyncDeviceProxy
from tango.asyncio_executor import set_global_executor
from tango.server import Device, attribute, command
from tango.test_context import MultiDeviceTestContext
from tango.test_utils import assert_close
from tango.test_utils import assert_close, green_mode


class TestEnum(IntEnum):
Expand All @@ -49,7 +50,7 @@ class TestEnum(IntEnum):
class TestDevice(Device):
__test__ = False

_array = [[1, 2, 3], [4, 5, 6]]
_array = [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]

_justvalue = 5
_writeonly = 6
Expand Down Expand Up @@ -259,12 +260,13 @@ def get_test_descriptor(python_type: type[T], value: T, is_cmd: bool) -> dict:


# --------------------------------------------------------------------
@pytest.fixture(scope="module")
def tango_test_device():
with MultiDeviceTestContext(
[{"class": TestDevice, "devices": [{"name": "test/device/1"}]}], process=True
) as context:
yield context.get_device_access("test/device/1")
@pytest.fixture()
async def tango_test_device():
return MultiDeviceTestContext(
[{"class": TestDevice, "devices": [{"name": "test/device/1"}]}],
green_mode=GreenMode.Asyncio,
process=True,
)


# --------------------------------------------------------------------
Expand Down Expand Up @@ -298,20 +300,27 @@ def compare_values(expected, received):


# --------------------------------------------------------------------


@pytest.mark.asyncio
async def test_connect(tango_test_device):
values, description = await describe_class(tango_test_device)
test_device = TestTangoReadable(tango_test_device)
return

async with DeviceCollector():
test_device = TestTangoReadable(tango_test_device)
...

assert test_device.name == "test_device"
assert description == await test_device.describe()
compare_values(values, await test_device.read())


"""
# --------------------------------------------------------------------
@pytest.mark.asyncio
async def test_set_trl(tango_test_device):
values, description = await describe_class(tango_test_device)
test_device = TestTangoReadable(name="test_device")
Expand All @@ -325,7 +334,7 @@ async def test_set_trl(tango_test_device):
# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.parametrize("proxy", [True, False, None])
async def test_connect_proxy(tango_test_device, proxy: bool | None):
if proxy is None:
Expand All @@ -345,7 +354,7 @@ async def test_connect_proxy(tango_test_device, proxy: bool | None):
# --------------------------------------------------------------------
@pytest.mark.asyncio
async def test_with_bluesky(tango_test_device):
# now let's do some bluesky stuff
RE = RunEngine()
Expand All @@ -355,7 +364,7 @@ async def test_with_bluesky(tango_test_device):
# --------------------------------------------------------------------
@pytest.mark.asyncio
async def test_tango_demo(demo_test_context):
with demo_test_context:
detector = TangoDetector(
Expand All @@ -380,3 +389,4 @@ async def test_tango_demo(demo_test_context):
await stop_status
assert all([set_status.done, stop_status.done])
assert all([set_status.success, stop_status.success])
"""
Loading

0 comments on commit bdeb30a

Please sign in to comment.