def execute_args(args): """Execute args.which command :param args: argparse args :return: None """ if not getattr(args, 'which', None) or args.which == 'run': Listener(args.config).run(root_allowed=args.root_allowed) elif args.which == 'check-config': check_config(args.config) elif args.which == 'test-device': test_device(args.device, args.config, args.root_allowed) elif args.which == 'discovery': from amazon_dash.discovery import discover discover()
def test_success(self): test_device('44:65:0D:48:FA:88', self.file) self.execute_mock_req.assert_called_once()
def test_invalid_device(self): with self.assertRaises(InvalidDevice): test_device('00:11:22:33:44:55', self.file)
def test_device(device, config, root_allowed): from amazon_dash.listener import test_device test_device(device, config, root_allowed)