def METHOD_NAME(self):
    args = []
    # Missing --url, --build-key, --name
    with self.assertRaises(SystemExit):
        c, cmd = client.commandline_client(args)
    # Missing --build-key, --name
    args.extend(['--url', 'testUrl'])
    with self.assertRaises(SystemExit):
        c, cmd = client.commandline_client(args)
    # Missing --name
    args.extend(['--build-key', '123'])
    with self.assertRaises(SystemExit):
        c, cmd = client.commandline_client(args)
    # this is the last required arg
    args.extend(['--name', 'testName'])
    c, cmd = client.commandline_client(args)
    good_args = args
    self.assertEqual(c.client_info["server"], 'testUrl')
    self.assertEqual(c.client_info["build_key"], '123')
    self.assertEqual(c.client_info["client_name"], 'testName')
    args.extend([
        '--single-shot',
        '--poll',
        '1',
        '--log-dir',
        '/tmp',
        '--insecure',
        ])
    c, cmd = client.commandline_client(args)
    self.assertEqual(c.client_info["single_shot"], True)
    self.assertEqual(c.client_info["ssl_verify"], False)
    self.assertEqual(c.client_info["poll"], 1)
    self.assertEqual('/tmp', os.path.dirname(c.client_info["log_file"]))
    args.extend([ '--ssl-cert', 'my_cert'])
    args.extend([ '--log-file', '/tmp/testFile'])
    c, cmd = client.commandline_client(args)
    self.assertEqual(c.client_info["log_file"], '/tmp/testFile')
    self.assertEqual(c.client_info["ssl_verify"], 'my_cert')
    args = good_args
    args.extend(['--daemon', 'start'])
    # Missing --configs
    with self.assertRaises(BaseClient.ClientException):
        client.commandline_client(args)
    args.extend(['--configs', 'config'])
    c, cmd = client.commandline_client(args)
    self.assertIn('config', c.get_client_info('build_configs'))
    self.assertEqual(cmd, 'start')
    args.extend(['--env', 'FOO', 'bar'])
    c, cmd = client.commandline_client(args)
    self.assertEqual('bar', c.get_environment('FOO'))
    build_root_before = os.environ.get('BUILD_ROOT', None)
    os.environ['BUILD_ROOT'] = '/foo/bar'
    c, cmd = client.commandline_client(args)
    self.assertEqual('/foo/bar', c.get_environment('BUILD_ROOT'))
    if build_root_before:
        os.environ['BUILD_ROOT'] = build_root_before
    else:
        del os.environ['BUILD_ROOT']
    args = good_args
    args.extend(['--daemon', 'stop'])
    c, cmd = client.commandline_client(args)
    self.assertEqual(cmd, 'stop')
    args = good_args
    args.extend(['--daemon', 'restart'])
    c, cmd = client.commandline_client(args)
    self.assertEqual(cmd, 'restart')
    args = good_args
    args.extend(['--daemon', 'foo'])
    with self.assertRaises(SystemExit):
        c, cmd = client.commandline_client(args)