Example #1
0
def working_symlinks_in_dot_bin_to_files_under_whack_root_are_created_in_bin():
    deployed_package = _deploy_package(
        [
            sh_script_description(".bin/hello", "echo Hello there"),
            symlink(".bin/hello-sym", os.path.join(WHACK_ROOT, ".bin/hello")),
            symlink(".bin/hello-borked", os.path.join(WHACK_ROOT, ".bin/hell")),
        ]
    )
    with deployed_package:
        command = [deployed_package.path("bin/hello-sym")]
        _assert_output(command, b"Hello there\n")
        assert not os.path.exists(deployed_package.path("bin/hello-borked"))
Example #2
0
def broken_symlinked_dot_bin_is_ignored():
    deployed_package = _deploy_package(
        [sh_script_description("bin/hello", "echo Hello there"), symlink(".bin", "sub/binn")]
    )
    with deployed_package:
        command = [deployed_package.path("bin/hello")]
        _assert_output(command, b"Hello there\n")
Example #3
0
def placing_executables_under_symlinked_dot_bin_creates_directly_executable_files_under_bin():
    deployed_package = _deploy_package(
        [
            plain_file("message", "Hello there"),
            sh_script_description("sub/bin/hello", "cat {0}/message".format(WHACK_ROOT)),
            symlink(".bin", os.path.join(WHACK_ROOT, "sub/bin")),
        ]
    )
    with deployed_package:
        command = [deployed_package.path("bin/hello")]
        _assert_output(command, b"Hello there")
Example #4
0
def relative_symlinks_in_dot_bin_are_created_in_bin():
    deployed_package = _deploy_package(
        [
            plain_file("message", "Hello there"),
            sh_script_description("sub/bin/hello", "cat {0}/message".format(WHACK_ROOT)),
            symlink(".bin", "sub/bin"),
        ]
    )
    with deployed_package:
        command = [deployed_package.path("bin/hello")]
        _assert_output(command, b"Hello there")