def test_block(self):
        mock = MagicMock(side_effect=[False, True])
        with patch.object(salt.utils.validate.net, 'mac', mock):
            self.assertRaises(CommandExecutionError,
                              bluez.block, "DE:AD:BE:EF:CA:ZE")

            mock = MagicMock(return_value="")
            with patch.dict(bluez.__salt__, {'cmd.run': mock}):
                self.assertIsNone(bluez.block("DE:AD:BE:EF:CA:FE"))
Test of blocking specific bluetooth device
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/bluez_test.py/BluezTestCase.test_block