# Path: shipwright/_lib/cli.py
# def argparser():
#     def a_arg(parser, *args, **kwargs):
# def parse_registry_logins(registry_logins):
# def _flatten(items):
# def old_style_arg_dict(namespace):
# def main():
# def process_arguments(path, arguments, client_cfg, environ):
#     def default(self, obj):
# def run(path, arguments, client_cfg, environ, new_style_args=None):
# def exit(msg):
# def memo(f, arg, memos={}):
# def pretty_event(evt, show_progress):
# def highlight(name):
#     def highlight_(msg):
# def switch(rec, show_progress):
# class SetJSONEncoder(json.JSONEncoder):


import git
import pytest
from docker import tls
from shipwright._lib import cli
        path, in_args, client_cfg={},
        environ={'SW_NAMESPACE': 'eg'},
    )
    assert not no_build


def test_assert_hostname(tmpdir):
    path = str(tmpdir.join('no-manifest'))
    create_repo(path)
    args = get_defaults()
    args['--x-assert-hostname'] = True
    tls_config = tls.TLSConfig()
    _, _, _, _, _, client = cli.process_arguments(
        path, args,
        client_cfg={
            'base_url': 'https://example.com:443/api/v1/',
            'tls': tls_config,
        },
        environ={'SW_NAMESPACE': 'eg'},
    )

    assert not client.adapters['https://'].assert_hostname


def test_args():
    args = [
        '--account=x', '--x-assert-hostname', 'build',
        '-d', 'foo', '-d', 'bar',
        '-t', 'latest', '-t', 'foo',
    ]

# Path: shipwright/_lib/cli.py
# def argparser():
#     def a_arg(parser, *args, **kwargs):
# def parse_registry_logins(registry_logins):
# def _flatten(items):
# def old_style_arg_dict(namespace):
# def main():
# def process_arguments(path, arguments, client_cfg, environ):
#     def default(self, obj):
# def run(path, arguments, client_cfg, environ, new_style_args=None):
# def exit(msg):
# def memo(f, arg, memos={}):
# def pretty_event(evt, show_progress):
# def highlight(name):
#     def highlight_(msg):
# def switch(rec, show_progress):
# class SetJSONEncoder(json.JSONEncoder):


# Path: tests/test_cli.py
import git
import pytest
from docker import tls
from shipwright._lib import cli

        path, in_args, client_cfg={},
        environ={'SW_NAMESPACE': 'eg'},
    )
    assert not no_build


def test_assert_hostname(tmpdir):
    path = str(tmpdir.join('no-manifest'))
    create_repo(path)
    args = get_defaults()
    args['--x-assert-hostname'] = True
    tls_config = tls.TLSConfig()
    _, _, _, _, _, client = cli.process_arguments(
        path, args,
        client_cfg={
            'base_url': 'https://example.com:443/api/v1/',
            'tls': tls_config,
        },
        environ={'SW_NAMESPACE': 'eg'},
    )

    assert not client.adapters['https://'].assert_hostname


def test_args():
    args = [
        '--account=x', '--x-assert-hostname', 'build',
        '-d', 'foo', '-d', 'bar',
        '-t', 'latest', '-t', 'foo',
    ]

    parser = cli.argparser()