@patch('compass.hdsdiscovery.hdmanager.HDManager.get_sys_info')
    def test_get_vendor(self, sys_info_mock):
        # Incorrect ip
        vendor, state, err = self.manager.get_vendor('1234.1.1.1',
                                                     self.correct_credential)
        self.assertIsNone(vendor)
        self.assertEqual('error', state)

        # Incorrect credential
        incorr_cred = {'version': '1v', 'community': 'private'}
        vendor, state, err = self.manager.get_vendor(self.correct_host,
                                                     incorr_cred)
        self.assertIsNone(vendor)
        self.assertEqual('error', state)

        # SNMP get system description Timeout
        excepted_err_msg = 'Timeout: No Response from 127.0.0.1.'
        sys_info_mock.return_value = (None, excepted_err_msg)
        result, state, err = self.manager.get_vendor(self.correct_host,
                                                     self.correct_credential)
        self.assertIsNone(result)
        self.assertEqual(state, 'unreachable')
        self.assertEqual(err, excepted_err_msg)

        # No vendor plugin supported
        excepted_err_msg = 'Not supported switch vendor!'
        sys_info_mock.return_value = ('xxxxxx', excepted_err_msg)
        result, state, err = self.manager.get_vendor(self.correct_host,
                                                     self.correct_credential)
        self.assertIsNone(result)
        self.assertEqual(state, 'notsupported')
        self.assertEqual(err, excepted_err_msg)

        # Found the correct vendor
        sys_info = ['Huawei Versatile Routing Platform Software',
                    'ProCurve J9089A Switch 2610-48-PWR, revision R.11.25',
                    'Pica8 XorPlus Platform Software']
        expected_vendor_names = ['huawei', 'hp', 'pica8', 'appliance']
        for info, expected_vendor in zip(sys_info, expected_vendor_names):
            sys_info_mock.return_value = (info, '')
            # the result is a tuple ($vendor, $state, $error_message)
            result = self.manager.get_vendor(self.correct_host,
                                             self.correct_credential)
            self.assertEqual(result[0], expected_vendor)
Executes a command against the underlying HTML element.
dataset/ETHPy150Open openstack/compass-core/compass/tests/hdsdiscovery/test_hdsdiscovery.py/HDManagerTest.test_get_vendor--crossover with--dataset/ETHPy150Open apiad/sublime-browser-integration/selenium/webdriver/remote/webelement.py/WebElement._execute