def test_discoverable(self):
        mock = MagicMock(side_effect=[{}, {'hci0':
                                           {'device': 'hci0', 'power': 'on'}},
                                      {'hci0': {'device': 'hci0',
                                                'power': 'on'}}])
        with patch.object(bluez, 'address_', mock):
            self.assertRaises(CommandExecutionError,
                              bluez.discoverable, "hci0")

            mock = MagicMock(return_value="UP RUNNING ISCAN")
            with patch.dict(bluez.__salt__, {'cmd.run': mock}):
                self.assertTrue(bluez.discoverable("hci0"))

            mock = MagicMock(return_value="")
            with patch.dict(bluez.__salt__, {'cmd.run': mock}):
                self.assertFalse(bluez.discoverable("hci0"))
Returns the index of the given field name.
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/bluez_test.py/BluezTestCase.test_discoverable--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/gis/gdal/feature.py/Feature.index