File tree Expand file tree Collapse file tree 1 file changed +0
-23
lines changed
Expand file tree Collapse file tree 1 file changed +0
-23
lines changed Original file line number Diff line number Diff line change 149149 content = importer.succeed(f"cat {result_path}/hello.txt").strip()
150150 assert content == "Hello from tarball!", f"Content mismatch: {content}"
151151 print("✓ fetchTarball content verified!")
152-
153- ##########################################
154- # Test 3: Verify fetchTree does NOT substitute (preserves metadata)
155- ##########################################
156-
157- print("Testing that fetchTree without __final does NOT use substitution...")
158-
159- # fetchTree with just narHash (not __final) should try to download, which will fail
160- # since the file doesn't exist on the importer
161- exit_code = importer.fail(f"""
162- nix-instantiate --eval --json --read-write-mode --expr '
163- builtins.fetchTree {{
164- type = "tarball";
165- url = "file:///only-on-substituter.tar.gz";
166- narHash = "{tarball_hash_sri}";
167- }}
168- ' 2>&1
169- """)
170-
171- # Should fail with "does not exist" since it tries to download instead of substituting
172- assert "does not exist" in exit_code or "Couldn't open file" in exit_code, f"Expected download failure, got: {exit_code}"
173- print("✓ fetchTree correctly does NOT substitute non-final inputs!")
174- print(" (This preserves metadata like lastModified from the actual fetch)")
175152 '' ;
176153}
You can’t perform that action at this time.
0 commit comments