Ejemplo n.º 1
0
def test_inspect_hash_input(testing_metadata, testing_workdir, capfd):
    api.output_yaml(testing_metadata, 'meta.yaml')
    output = api.build(testing_workdir)[0]
    args = ['hash-inputs', output]
    main_inspect.execute(args)
    output, error = capfd.readouterr()
    assert 'requirements' in output
Ejemplo n.º 2
0
def test_inspect_prefix_length(testing_workdir, capfd):
    from conda_build import api

    # build our own known-length package here
    test_base = os.path.expanduser("~/cbtmp")
    config = api.Config(croot=test_base, anaconda_upload=False, verbose=True)
    recipe_path = os.path.join(metadata_dir, "has_prefix_files")
    fn = api.get_output_file_path(recipe_path, config=config)
    if os.path.isfile(fn):
        os.remove(fn)
    config.prefix_length = 80
    api.build(recipe_path, config=config)

    args = ["prefix-lengths", fn]
    with pytest.raises(SystemExit):
        main_inspect.execute(args)
        output, error = capfd.readouterr()
        assert "Packages with binary prefixes shorter than" in output
        assert fn in output

    config.prefix_length = 255
    api.build(recipe_path, config=config)
    main_inspect.execute(args)
    output, error = capfd.readouterr()
    assert "No packages found with binary prefixes shorter" in output
Ejemplo n.º 3
0
def test_inspect_hash_input(testing_metadata, testing_workdir, capfd):
    api.output_yaml(testing_metadata, 'meta.yaml')
    output = api.build(testing_workdir)[0]
    args = ['hash-inputs', output]
    main_inspect.execute(args)
    output, error = capfd.readouterr()
    assert 'requirements' in output
Ejemplo n.º 4
0
def test_inspect_hash_input(testing_metadata, testing_workdir, capfd):
    testing_metadata.meta['requirements']['build'] = ['zlib']
    api.output_yaml(testing_metadata, 'meta.yaml')
    output = api.build(testing_workdir, notest=True)[0]
    with open(os.path.join(testing_workdir, 'conda_build_config.yaml'), 'w') as f:
        yaml.dump({'zlib': ['1.2.11']}, f)
    args = ['hash-inputs', output]
    main_inspect.execute(args)
    output, error = capfd.readouterr()
    assert 'zlib' in output
Ejemplo n.º 5
0
def test_inspect_hash_input(testing_metadata, testing_workdir, capfd):
    testing_metadata.meta['requirements']['build'] = ['zlib']
    api.output_yaml(testing_metadata, 'meta.yaml')
    output = api.build(testing_workdir, notest=True)[0]
    with open(os.path.join(testing_workdir, 'conda_build_config.yaml'), 'w') as f:
        yaml.dump({'zlib': ['1.2.11']}, f)
    args = ['hash-inputs', output]
    main_inspect.execute(args)
    output, error = capfd.readouterr()
    assert 'zlib' in output
Ejemplo n.º 6
0
def test_inspect_objects(testing_workdir, capfd):
    # get a package that has known object output
    args = ['objects', 'python']
    if sys.platform != 'darwin':
        with pytest.raises(SystemExit) as exc:
            main_inspect.execute(args)
            assert 'conda inspect objects is only implemented in OS X' in exc
    else:
        main_inspect.execute(args)
        output, error = capfd.readouterr()
        assert re.search('rpath:.*@loader_path', output)
Ejemplo n.º 7
0
def test_inspect_linkages(testing_workdir, capfd):
    # get a package that has known object output
    args = ['linkages', 'python']
    if sys.platform == 'win32':
        with pytest.raises(SystemExit) as exc:
            main_inspect.execute(args)
            assert 'conda inspect linkages is only implemented in Linux and OS X' in exc
    else:
        main_inspect.execute(args)
        output, error = capfd.readouterr()
        assert 'libncursesw' in output
Ejemplo n.º 8
0
def test_inspect_objects(testing_workdir, capfd):
    # get a package that has known object output
    args = ['objects', 'python']
    if sys.platform != 'darwin':
        with pytest.raises(SystemExit) as exc:
            main_inspect.execute(args)
            assert 'conda inspect objects is only implemented in OS X' in exc
    else:
        main_inspect.execute(args)
        output, error = capfd.readouterr()
        assert 'rpath: @loader_path' in output
Ejemplo n.º 9
0
def test_inspect_linkages(testing_workdir, capfd):
    # get a package that has known object output
    args = ['linkages', 'python']
    if sys.platform == 'win32':
        with pytest.raises(SystemExit) as exc:
            main_inspect.execute(args)
            assert 'conda inspect linkages is only implemented in Linux and OS X' in exc
    else:
        main_inspect.execute(args)
        output, error = capfd.readouterr()
        assert 'openssl' in output
Ejemplo n.º 10
0
def test_inspect_prefix_length(testing_workdir, capfd):
    from conda_build import api
    # build our own known-length package here
    test_base = os.path.expanduser("~/cbtmp")
    config = api.Config(croot=test_base, anaconda_upload=False, verbose=True)
    recipe_path = os.path.join(metadata_dir, "has_prefix_files")
    config.prefix_length = 80
    outputs = api.build(recipe_path, config=config, notest=True)

    args = ['prefix-lengths'] + outputs
    with pytest.raises(SystemExit):
        main_inspect.execute(args)
        output, error = capfd.readouterr()
        assert 'Packages with binary prefixes shorter than' in output
        assert all(fn in output for fn in outputs)

    config.prefix_length = 255
    # reset the build id so that a new one is computed
    config._build_id = ""
    api.build(recipe_path, config=config, notest=True)
    main_inspect.execute(args)
    output, error = capfd.readouterr()
    assert 'No packages found with binary prefixes shorter' in output
Ejemplo n.º 11
0
def test_inspect_prefix_length(testing_workdir, capfd):
    from conda_build import api
    # build our own known-length package here
    test_base = os.path.expanduser("~/cbtmp")
    config = api.Config(croot=test_base, anaconda_upload=False, verbose=True)
    recipe_path = os.path.join(metadata_dir, "has_prefix_files")
    config.prefix_length = 80
    outputs = api.build(recipe_path, config=config)

    args = ['prefix-lengths'] + outputs
    with pytest.raises(SystemExit):
        main_inspect.execute(args)
        output, error = capfd.readouterr()
        assert 'Packages with binary prefixes shorter than' in output
        assert all(fn in output for fn in outputs)

    config.prefix_length = 255
    # reset the build id so that a new one is computed
    config._build_id = ""
    api.build(recipe_path, config=config)
    main_inspect.execute(args)
    output, error = capfd.readouterr()
    assert 'No packages found with binary prefixes shorter' in output
Ejemplo n.º 12
0
def test_inspect_prefix_length(testing_workdir, capfd):
    from conda_build import api
    # build our own known-length package here
    test_base = os.path.expanduser("~/cbtmp")
    config = api.Config(croot=test_base, anaconda_upload=False, verbose=True)
    recipe_path = os.path.join(metadata_dir, "has_prefix_files")
    fn = api.get_output_file_path(recipe_path, config=config)
    if os.path.isfile(fn):
        os.remove(fn)
    config.prefix_length = 80
    api.build(recipe_path, config=config)

    args = ['prefix-lengths', fn]
    with pytest.raises(SystemExit):
        main_inspect.execute(args)
        output, error = capfd.readouterr()
        assert 'Packages with binary prefixes shorter than' in output
        assert fn in output

    config.prefix_length = 255
    api.build(recipe_path, config=config)
    main_inspect.execute(args)
    output, error = capfd.readouterr()
    assert 'No packages found with binary prefixes shorter' in output
Ejemplo n.º 13
0
def test_inspect_installable(testing_workdir):
    args = ['channels', '--test-installable', 'conda-team']
    main_inspect.execute(args)
Ejemplo n.º 14
0
def test_inspect_hash_input(testing_metadata, capfd):
    output = api.build(testing_metadata)[0]
    args = ['hash-inputs', output]
    main_inspect.execute(args)
    output, error = capfd.readouterr()
    assert 'requirements' in output
Ejemplo n.º 15
0
def test_inspect_installable(testing_workdir):
    args = ['channels', '--test-installable', 'conda-team']
    main_inspect.execute(args)
Ejemplo n.º 16
0
def test_inspect_installable(testing_workdir):
    args = ["channels", "--test-installable", "conda-team"]
    main_inspect.execute(args)