Download this file
| 1 | package checks |
| 2 | |
| 3 | import ( |
| 4 | "context" |
| 5 | "io" |
| 6 | "os" |
| 7 | "testing" |
| 8 | |
| 9 | "amadan.net/oficina/equipo/internal/runner/provider" |
| 10 | ) |
| 11 | |
| 12 | type unprovenSandbox struct{} |
| 13 | |
| 14 | func (unprovenSandbox) Run(context.Context, Command, string, provider.ReadPolicy, io.Writer, io.Writer) (int, error) { |
| 15 | return -1, provider.ErrUncertain |
| 16 | } |
| 17 | func (unprovenSandbox) Contained(string) bool { return false } |
| 18 | |
| 19 | func TestCheckNamespaceRetainsScratchWithoutProof(t *testing.T) { |
| 20 | f := newFixture(t) |
| 21 | f.e.sandbox = unprovenSandbox{} |
| 22 | work, cleanup, err := f.e.scratch(context.Background(), baseID) |
| 23 | must(t, err) |
| 24 | cleanup() |
| 25 | if _, err = os.Stat(work); err != nil { |
| 26 | t.Fatal("removed checkout without containment proof") |
| 27 | } |
| 28 | } |
| 29 | |