# Yet another Artifacts question - when is a download triggered?

**URL:** <https://discourse.julialang.org/t/yet-another-artifacts-question-when-is-a-download-triggered/33452>\
**Category:** General Usage\
**Tags:** question\
**Created:** [January 16, 2020, 7:24pm UTC](https://discourse.julialang.org/t/yet-another-artifacts-question-when-is-a-download-triggered/33452 "2020-01-16T19:24:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmbates](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmbates/32/44_2.png) [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Post date:** [January 16, 2020, 7:24pm UTC](https://discourse.julialang.org/t/yet-another-artifacts-question-when-is-a-download-triggered/33452/1 "2020-01-16T19:24:08Z")

</div>

My `Artifacts.toml` file contains

```julia
[TestData]
git-tree-sha1 = "9d575764bc1c1a7860c34c5b153251e5f2ee6704"
lazy = true

    [[TestData.download]]
    sha256 = "7fcd1e390c59530e9ea00939afd1798813e3727b"
    url = "https://ndownloader.figshare.com/files/21085968"

```

I can probably find this out by experimenting or, when all else fails, read the code, but does a call to

```julia
julia> test_data_hash = artifact_hash("TestData", test_artifacts_toml)

```

trigger the download of the artifact if it does not currently exist?

Also, how would I go about using the `@artifact_str` facility? I can’t get it to work because I can’t figure out how to tell it where the `Artifacts.toml` file is.

```julia
julia> artifact"TestData"
ERROR: LoadError: Cannot locate '(Julia)Artifacts.toml' file when attempting to use artifact 'TestData' in 'Main'
Stacktrace:
 [1] @artifact_str(::LineNumberNode, ::Module, ::Any) at /home/bates/src/julia-1.3.1/share/julia/stdlib/v1.3/Pkg/src/Artifacts.jl:1001
in expression starting at none:1

```

My goal is to have a `test/Artifacts.toml` to load the data that I use for testing the package. It is not needed for the package itself to function so I would like to isolate it in the test directory.

---

<div class="post-metadata">

**Author:** ![dmbates](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmbates/32/44_2.png) [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Post date:** [January 16, 2020, 8:08pm UTC](https://discourse.julialang.org/t/yet-another-artifacts-question-when-is-a-download-triggered/33452/2 "2020-01-16T20:08:49Z")

</div>

To answer a couple of my own questions, it appears that the `artifact` string macro is intended to be used in the code for the Project (package) and looks first in the top-level Project directory for `Artifacts.toml`. So I don’t think it will work to have the test data only loaded for the tests unless I do all the steps of determining the artifact hash, etc by hand.
