def METHOD_NAME(cli, tmpdir, datafiles):
    project = str(datafiles)
    generate_project(project, {"aliases": {"tmpdir": "file:///" + str(tmpdir)}})
    checkoutdir = os.path.join(str(tmpdir), "checkout")
    # Try to fetch it
    result = cli.run(project=project, args=["source", "fetch", "target.bst"])
    result.assert_success()
    result = cli.run(project=project, args=["build", "target.bst"])
    result.assert_success()
    result = cli.run(project=project, args=["artifact", "checkout", "target.bst", "--directory", checkoutdir])
    result.assert_success()
    assert not os.path.exists(os.path.join(checkoutdir, "file"))
    assert os.path.exists(os.path.join(checkoutdir, "custom-file"))