Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for tempfile (0.18 sec)

  1. internal/config/certs_test.go

    func createTempFile(prefix, content string) (tempFile string, err error) {
    	var tmpfile *os.File
    
    	if tmpfile, err = os.CreateTemp("", prefix); err != nil {
    		return tempFile, err
    	}
    
    	if _, err = tmpfile.Write([]byte(content)); err != nil {
    		return tempFile, err
    	}
    
    	if err = tmpfile.Close(); err != nil {
    		return tempFile, err
    	}
    
    	tempFile = tmpfile.Name()
    	return tempFile, err
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 21.6K bytes
    - Viewed (0)
  2. cmd/update_test.go

    func TestGetHelmVersion(t *testing.T) {
    	createTempFile := func(content string) string {
    		tmpfile, err := os.CreateTemp("", "helm-testfile-")
    		if err != nil {
    			t.Fatalf("Unable to create temporary file. %s", err)
    		}
    		if _, err = tmpfile.WriteString(content); err != nil {
    			t.Fatalf("Unable to create temporary file. %s", err)
    		}
    		if err = tmpfile.Close(); err != nil {
    			t.Fatalf("Unable to create temporary file. %s", err)
    		}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Mar 09 03:07:08 GMT 2024
    - 10.7K bytes
    - Viewed (0)
  3. internal/disk/stat_test.go

    	}
    
    	for _, testCase := range testCases {
    		testCase := testCase
    		t.Run("", func(t *testing.T) {
    			tmpfile, err := os.CreateTemp("", "testfile")
    			if err != nil {
    				t.Error(err)
    			}
    			tmpfile.WriteString(testCase.stat)
    			tmpfile.Sync()
    			tmpfile.Close()
    
    			iostats, err := readDriveStats(tmpfile.Name())
    			if err != nil && !testCase.expectErr {
    				t.Fatalf("unexpected err; %v", err)
    			}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Feb 26 19:34:50 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  4. cmd/bitrot_test.go

    package cmd
    
    import (
    	"context"
    	"io"
    	"testing"
    )
    
    func testBitrotReaderWriterAlgo(t *testing.T, bitrotAlgo BitrotAlgorithm) {
    	tmpDir := t.TempDir()
    
    	volume := "testvol"
    	filePath := "testfile"
    
    	disk, err := newLocalXLStorage(tmpDir)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	disk.MakeVol(context.Background(), volume)
    
    	writer := newBitrotWriter(disk, "", volume, filePath, 35, bitrotAlgo, 10)
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Jan 30 20:43:25 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  5. src/archive/tar/reader_test.go

    }
    
    func TestFileReader(t *testing.T) {
    	type (
    		testRead struct { // Read(cnt) == (wantStr, wantErr)
    			cnt     int
    			wantStr string
    			wantErr error
    		}
    		testWriteTo struct { // WriteTo(testFile{ops}) == (wantCnt, wantErr)
    			ops     fileOps
    			wantCnt int64
    			wantErr error
    		}
    		testRemaining struct { // logicalRemaining() == wantLCnt, physicalRemaining() == wantPCnt
    			wantLCnt int64
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Nov 21 21:14:38 GMT 2022
    - 47.1K bytes
    - Viewed (0)
  6. internal/ioutil/ioutil_test.go

    	f, err := os.CreateTemp("", "")
    	if err != nil {
    		t.Errorf("Error creating tmp file: %v", err)
    	}
    	tmpFile := f.Name()
    	f.Close()
    	defer os.Remove(f.Name())
    	fi1, err := os.Stat(tmpFile)
    	if err != nil {
    		t.Fatalf("Error Stat(): %v", err)
    	}
    	fi2, err := os.Stat(tmpFile)
    	if err != nil {
    		t.Fatalf("Error Stat(): %v", err)
    	}
    	if !SameFile(fi1, fi2) {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Feb 02 11:02:31 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  7. src/archive/tar/tar_test.go

    	"time"
    )
    
    type testError struct{ error }
    
    type fileOps []any // []T where T is (string | int64)
    
    // testFile is an io.ReadWriteSeeker where the IO operations performed
    // on it must match the list of operations in ops.
    type testFile struct {
    	ops fileOps
    	pos int64
    }
    
    func (f *testFile) Read(b []byte) (int, error) {
    	if len(b) == 0 {
    		return 0, nil
    	}
    	if len(f.ops) == 0 {
    		return 0, io.EOF
    	}
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Mar 15 16:01:50 GMT 2024
    - 24K bytes
    - Viewed (0)
  8. src/archive/tar/writer_test.go

    			hdr     Header
    			wantErr error
    		}
    		testWrite struct { // Write(str) == (wantCnt, wantErr)
    			str     string
    			wantCnt int
    			wantErr error
    		}
    		testReadFrom struct { // ReadFrom(testFile{ops}) == (wantCnt, wantErr)
    			ops     fileOps
    			wantCnt int64
    			wantErr error
    		}
    		testClose struct { // Close() == wantErr
    			wantErr error
    		}
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Tue Feb 27 16:39:23 GMT 2024
    - 38.7K bytes
    - Viewed (0)
  9. src/archive/zip/reader_test.go

    		Name: "readme.zip",
    	},
    	{
    		Name:  "readme.notzip",
    		Error: ErrFormat,
    	},
    	{
    		Name: "dd.zip",
    		File: []ZipTestFile{
    			{
    				Name:     "filename",
    				Content:  []byte("This is a test textfile.\n"),
    				Modified: time.Date(2011, 2, 2, 13, 6, 20, 0, time.UTC),
    				Mode:     0666,
    			},
    		},
    	},
    	{
    		// created in windows XP file manager.
    		Name: "winxp.zip",
    		File: []ZipTestFile{
    			{
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Mar 27 18:23:49 GMT 2024
    - 55.3K bytes
    - Viewed (0)
  10. cmd/xl-storage_test.go

    	// create xlStorage test setup
    	storage, path, err := newXLStorageTestSetup(t)
    	if err != nil {
    		t.Fatalf("Unable to create xlStorage test setup, %s", err)
    	}
    
    	volName := "testvol"
    	fileName := "testfile"
    	if err := storage.MakeVol(context.Background(), volName); err != nil {
    		t.Fatal(err)
    	}
    
    	// 1) Whole-file bitrot check on proper file
    	size := int64(4*1024*1024 + 100*1024) // 4.1 MB
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 11 17:45:28 GMT 2024
    - 66.7K bytes
    - Viewed (0)
Back to top