<s> import os <EOL> import pytest <EOL> from . . utils . indi import PanIndiServer , PanIndiDevice <EOL> from . . utils . logger import get_logger <EOL> logger = get_logger ( self ) <EOL> class TestIndiBasics ( object ) : <EOL> """<STR_LIT>""" <EOL> def test_server_create_and_delete ( self ) : <EOL> """<STR_LIT>""" <EOL> logger . info ( "<STR_LIT>" ) <EOL> indi_server = PanIndiServer ( ) <EOL> pid = indi_server . _proc . pid <EOL> fifo_file = indi_server . _fifo <EOL> assert pid > <NUM_LIT:0> , "<STR_LIT>" <EOL> assert os . getpgid ( pid ) , "<STR_LIT>" <EOL> assert indi_server . is_connected , "<STR_LIT>" <EOL> del indi_server <EOL> assert os . getpgid ( pid ) is not True , "<STR_LIT>" <EOL> assert os . path . exists ( fifo_file ) is not True , "<STR_LIT>" <EOL> def test_device_create ( self ) : <EOL> """<STR_LIT>""" <EOL> logger . info ( "<STR_LIT>" ) <EOL> device = None <EOL> with pytest . raises ( TypeError ) : <EOL> device = PanIndiDevice ( ) <EOL> name = '<STR_LIT>' <EOL> driver = '<STR_LIT>' <EOL> device = PanIndiDevice ( name , driver ) <EOL> assert isinstance ( device , PanIndiDevice ) , "<STR_LIT>" <EOL> assert device . is_loaded is not True , "<STR_LIT>" <EOL> assert device . is_connected is not True , "<STR_LIT>" <EOL> def test_basic ( self ) : <EOL> """<STR_LIT>""" <EOL> logger . info ( "<STR_LIT>" ) <EOL> indi_server = PanIndiServer ( ) <EOL> assert indi_server . is_connected , "<STR_LIT>" <EOL> name = '<STR_LIT>' <EOL> driver = '<STR_LIT>' <EOL> device = PanIndiDevice ( name , driver ) <EOL> indi_server . load_driver ( name , driver ) <EOL> assert device . is_loaded , "<STR_LIT>" <EOL> del indi_server <EOL> def test_v4l2 ( self ) : <EOL> """<STR_LIT>""" <EOL> logger . info ( "<STR_LIT>" ) <EOL> indi_server = PanIndiServer ( ) <EOL> assert indi_server . is_connected , "<STR_LIT>" <EOL> name = '<STR_LIT>' <EOL> driver = '<STR_LIT>' <EOL> device = PanIndiDevice ( name , driver ) <EOL> indi_server . load_driver ( name , driver ) <EOL> device . connect ( ) <EOL> assert device . is_connected , "<STR_LIT>" <EOL> assert device . is_loaded , "<STR_LIT>" </s>
