Example #1
0
def test_updateStatus_2():
    app.device = Device()
    app.client = Client()
    app.client.connected = True

    suc = app.updateStatus()
    assert suc
Example #2
0
def test_updateStatus_1():
    app.device = Device()
    app.client = Client()
    app.client.connected = False

    suc = app.updateStatus()
    assert not suc
def test_setUpdateConfig_6():
    app.name = 'test'
    app.device = Device()
    app.client = Client()
    app.UPDATE_RATE = 0
    with mock.patch.object(app.device, 'getNumber', return_value={'PERIOD':
                                                                  1}):
        with mock.patch.object(app.client, 'sendNewNumber', return_value=True):
            suc = app.setUpdateConfig('test')
            assert suc
Example #4
0
def test_slewToAltAz_6():
    app.device = Device()
    app.client = Client()
    app.name = 'test'

    with mock.patch.object(app.device,
                           'getNumber',
                           return_value={'DOME_ABSOLUTE_POSITION': 1}):
        with mock.patch.object(app.client,
                               'sendNewNumber',
                               return_value=True):
            suc = app.slewToAltAz()
            assert suc
def test_sendCoverPark_5():
    app.name = 'test'
    app.device = Device()
    app.client = Client()
    app.UPDATE_RATE = 0
    with mock.patch.object(app.device,
                           'getSwitch',
                           return_value={
                               'PARK': True,
                               'UNPARK': False
                           }):
        with mock.patch.object(app.client, 'sendNewSwitch', return_value=True):
            suc = app.sendCoverPark()
            assert suc
Example #6
0
import time
import sys
from indibase.indiBase import Client

# connect the server
indiclient = Client()
indiclient.setServer("localhost", 7624)

if not (indiclient.connectServer()):
    print("No indi server running on " + indiclient.getHost() + ":" +
          str(indiclient.getPort()) + " - Try to run")
    print("  indi server indi_simulator_telescope indi_simulator_ccd")
    sys.exit(1)

# connect the scope
telescope = "Telescope Simulator"
device_telescope = None
telescope_connect = None

# get the telescope device
device_telescope = indiclient.getDevice(telescope)
while not (device_telescope):
    time.sleep(0.5)
    device_telescope = indiclient.getDevice(telescope)

# wait CONNECTION property be defined for telescope
telescope_connect = device_telescope.getSwitch("CONNECTION")
while not (telescope_connect):
    time.sleep(0.5)
    telescope_connect = device_telescope.getSwitch("CONNECTION")
Example #7
0
import time
import sys
from indibase.indiBase import Client


# connect the server
indiclient = Client()
indiclient.setServer("astro-comp.fritz.box", 7624)

if not (indiclient.connectServer()):
    print("No indi server running on "
          + indiclient.getHost()
          + ":"
          + str(indiclient.getPort()) + " - Try to run")
    print("  indi server indi_simulator_telescope indi_simulator_ccd")
    sys.exit(1)

# connect the camera
camera = "CCD Simulator"
device_camera = None
connect_camera = None
# connect the filter
filterwheel = "CCD Simulator"
device_filterwheel = None
connect_filterwheel = None

# get the telescope device
device_camera = indiclient.getDevice(telescope)
while not (device_telescope):
    time.sleep(0.5)
    device_telescope = indiclient.getDevice(telescope)