def test_check_multichannel_interface3(self):
        """Check the multichannel specific tests, failing = profile.

        """
        interface = MultiChannelVoltageSourceInterface(task=self.task)
        interface.channel = (1, 1)
        self.task.interface = interface
        self.task.target_value = '1.0'
        self.task.selected_instrument = ()

        test, traceback = self.task.check()
        assert not test
        assert len(traceback) == 1
    def test_check_multichannel_interface1(self):
        """Check the multichannel specific tests, passing.

        """
        interface = MultiChannelVoltageSourceInterface(task=self.task)
        interface.channel = (1, 1)
        self.task.interface = interface
        self.task.target_value = '1.0'

        c = self.root.run_time[PROFILES]['Test1']['connections']
        c['C'] = {'defined_channels': [[(1, 1)]]}

        test, traceback = self.task.check(test_instr=True)
        assert test
        assert not traceback
    def test_perform_multichannel_interface(self):
        """Test using the interface for the setting.

        """
        interface = MultiChannelVoltageSourceInterface(task=self.task)
        interface.channel = (1, 1)
        self.task.interface = interface
        self.task.target_value = '1.0'

        c = self.root.run_time[PROFILES]['Test1']['connections']
        c['C'] = {'voltage': [0.0], 'function': 'VOLT', 'owner': [None]}
        s = self.root.run_time[PROFILES]['Test1']['settings']
        s['S'] = {'get_channel': lambda x, i: x}

        self.root.prepare()
        self.task.perform()
        assert self.root.get_from_database('Test_voltage') == 1.0