| 29 | ) |
| 30 | |
| 31 | func TestCreate(t *testing.T) { |
| 32 | g := gomega.NewGomegaWithT(t) |
| 33 | |
| 34 | // This would get called in StartPullerAndProcessModels |
| 35 | syscall.Umask(0) |
| 36 | |
| 37 | tmpDir := t.TempDir() |
| 38 | folderPath := path.Join(tmpDir, "foo") |
| 39 | filePath := path.Join(folderPath, "bar.txt") |
| 40 | f, err := Create(filePath) |
| 41 | if err != nil { |
| 42 | t.Fatalf("Unable to create file: %v", err) |
| 43 | } |
| 44 | defer func() { _ = f.Close() }() |
| 45 | |
| 46 | g.Expect(err).ToNot(gomega.HaveOccurred()) |
| 47 | g.Expect(folderPath).To(gomega.BeADirectory()) |
| 48 | |
| 49 | info, _ := os.Stat(folderPath) |
| 50 | mode := info.Mode() |
| 51 | expectedMode := os.ModePerm |
| 52 | g.Expect(mode.Perm()).To(gomega.Equal(expectedMode)) |
| 53 | } |
| 54 | |
| 55 | func TestFileExists(t *testing.T) { |
| 56 | g := gomega.NewGomegaWithT(t) |