Beispiel #1
0
def test_find_prefix_files(testing_workdir):
    """
    Write test output that has the prefix to be found, then verify that the prefix finding
    identified the correct number of files.
    """
    # create text files to be replaced
    files = []
    for slash_style in prefix_tests:
        filename = os.path.join(testing_workdir, "%s.txt" % slash_style)
        _write_prefix(filename, testing_workdir, prefix_tests[slash_style])
        files.append(filename)

    assert len(list(build.have_prefix_files(files, testing_workdir))) == len(files)
Beispiel #2
0
def test_find_prefix_files(testing_workdir):
    """
    Write test output that has the prefix to be found, then verify that the prefix finding
    identified the correct number of files.
    """
    # create text files to be replaced
    files = []
    for slash_style in prefix_tests:
        filename = os.path.join(testing_workdir, "%s.txt" % slash_style)
        _write_prefix(filename, testing_workdir, prefix_tests[slash_style])
        files.append(filename)

    assert len(list(build.have_prefix_files(files, testing_workdir))) == len(files)
Beispiel #3
0
def test_find_prefix_files():
    """
    Write test output that has the prefix to be found, then verify that the prefix finding
    identified the correct number of files.
    """
    if not os.path.isdir(config.build_prefix):
        os.makedirs(config.build_prefix)
    with TemporaryDirectory(prefix=config.build_prefix + os.path.sep) as tmpdir:
        # create text files to be replaced
        files = []
        for slash_style in prefix_tests:
            filename = os.path.join(tmpdir, "%s.txt" % slash_style)
            _write_prefix(filename, config.build_prefix, prefix_tests[slash_style])
            files.append(filename)

        assert len(list(build.have_prefix_files(files))) == len(files)
Beispiel #4
0
def test_find_prefix_files():
    """
    Write test output that has the prefix to be found, then verify that the prefix finding
    identified the correct number of files.
    """
    if not os.path.isdir(config.build_prefix):
        os.makedirs(config.build_prefix)
    with TemporaryDirectory(prefix=config.build_prefix +
                            os.path.sep) as tmpdir:
        # create text files to be replaced
        files = []
        for slash_style in prefix_tests:
            filename = os.path.join(tmpdir, "%s.txt" % slash_style)
            _write_prefix(filename, config.build_prefix,
                          prefix_tests[slash_style])
            files.append(filename)

        assert len(list(build.have_prefix_files(files))) == len(files)