def test_UI_GIVEN_command_producer_WHEN_checking_connection_status_THEN_command_led_is_turned_on( qtbot, instrument): window = FileWriterCtrl(instrument) qtbot.addWidget(window) window.command_producer = Mock() window.status_consumer = None window.command_producer.connected = True window._check_connection_status() assert window.command_broker_led.is_on()
def test_UI_GIVEN_no_status_consumer_and_no_command_producer_WHEN_checking_status_connection_THEN_both_leds_are_turned_off( qtbot, instrument): window = FileWriterCtrl(instrument) qtbot.addWidget(window) window.status_consumer = None window.command_producer = None window._check_connection_status() assert window.status_broker_led.is_off() assert window.command_broker_led.is_off()