RemoteGroupTestCase#
- class lsst.ts.observatory.control.RemoteGroupTestCase#
Bases:
objectBase class for testing groups of CSCs.
Subclasses must:
Inherit both from this and
asynctest.TestCase.Override
basic_make_groupto make the script and any other controllers, remotes and such, and return a list of scripts, controllers and remotes that you made.
A typical test will look like this:
- async def test_something(self):
- async with make_group():
# … test something
Methods Summary
basic_make_group([usage])Make a group as self.group.
close()Optional cleanup before closing.
make_group([timeout, usage, verbose])Create a Group.
run([result])Override
runto set a random LSST_DDS_PARTITION_PREFIX and set LSST_SITE=test for every test.wait_for(coro, timeout, description, verbose)A wrapper around asyncio.wait_for that prints timing information.
Methods Documentation
- abstract async basic_make_group(usage=None)#
Make a group as self.group.
Make all other controllers and remotes, as well and return a list of the items made.
- Returns:
items – Controllers, Remotes and Group, or any other items for which to initially wait for
item.start_taskand finally wait foritem.close().- Return type:
List[any]
Notes
This is a coroutine in the unlikely case that you might want to wait for something.
- make_group(timeout=30, usage=None, verbose=False)#
Create a Group.
The group is accessed as
self.group.- Parameters:
- Return type:
- run(result=None)#
Override
runto set a random LSST_DDS_PARTITION_PREFIX and set LSST_SITE=test for every test.
- async wait_for(coro, timeout, description, verbose)#
A wrapper around asyncio.wait_for that prints timing information.
- Parameters:
coro (
awaitable) – Coroutine or task to await.timeout (
float) – Timeout (seconds)description (
str) – Description of what is being awaited.verbose (
bool) – If True then print a message before waiting and another after that includes how long it waited. If False only print a message if the wait times out.
- Return type: