Пример #1
0
def test_without_json_manifest(tmpdir):
    path = str(tmpdir.join('no-manifest'))
    create_repo(path)
    with pytest.raises(SystemExit):
        cli.process_arguments(
            path, get_defaults(), client_cfg={}, environ={},
        )
Пример #2
0
def test_without_json_manifest(tmpdir):
    path = str(tmpdir.join('no-manifest'))
    create_repo(path)
    with pytest.raises(SystemExit):
        cli.process_arguments(
            path,
            get_defaults(),
            client_cfg={},
            environ={},
        )
Пример #3
0
def test_push_also_builds(tmpdir):
    path = str(tmpdir.join("no-manifest"))
    create_repo(path)
    in_args = get_defaults()
    in_args["push"] = True
    _, no_build, _, _, _, _ = cli.process_arguments(path, in_args, client_cfg={}, environ={"SW_NAMESPACE": "eg"})
    assert not no_build
Пример #4
0
def test_push_also_builds(tmpdir):
    path = str(tmpdir.join('no-manifest'))
    create_repo(path)
    in_args = get_defaults()
    in_args['push'] = True
    _, no_build, _, _, _, _ = cli.process_arguments(
        path, in_args, client_cfg={},
        environ={'SW_NAMESPACE': 'eg'},
    )
    assert not no_build
Пример #5
0
def test_push_also_builds(tmpdir):
    path = str(tmpdir.join('no-manifest'))
    create_repo(path)
    in_args = get_defaults()
    in_args['push'] = True
    _, no_build, _, _, _, _ = cli.process_arguments(
        path,
        in_args,
        client_cfg={},
        environ={'SW_NAMESPACE': 'eg'},
    )
    assert not no_build
Пример #6
0
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
Пример #7
0
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
Пример #8
0
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