Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 57 for ReadAll (0.07 sec)

  1. cmd/dummy-data-generator_test.go

    }
    
    func TestDummyDataGenerator(t *testing.T) {
    	readAll := func(r io.Reader) string {
    		b, _ := io.ReadAll(r)
    		return string(b)
    	}
    	checkEq := func(a, b string) {
    		if a != b {
    			t.Fatalf("Unexpected equality failure")
    		}
    	}
    
    	checkEq(readAll(NewDummyDataGen(0, 0)), "")
    
    	checkEq(readAll(NewDummyDataGen(10, 0)), readAll(NewDummyDataGen(10, int64(len(alphabets)))))
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Jul 02 15:13:05 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  2. istioctl/pkg/writer/envoy/configdump/secret_test.go

    			defer configDumpFile.Close()
    			configDump, err := io.ReadAll(configDumpFile)
    			if err != nil {
    				t.Errorf("error reading test data file: %v", err)
    			}
    
    			outFile, err := os.Open(fmt.Sprintf("testdata/secret/%s/output", tc.sds))
    			if err != nil {
    				t.Errorf("error opening test data output file: %v", err)
    			}
    			defer outFile.Close()
    			expectedOut, err := io.ReadAll(outFile)
    			if err != nil {
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Mon Oct 28 19:52:53 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  3. src/archive/zip/writer_test.go

    		if err != nil {
    			t.Errorf("%s: Open err = %v", got.Name, err)
    			continue
    		}
    
    		buf, err := io.ReadAll(r)
    		if err != nil {
    			t.Errorf("%s: ReadAll err = %v", got.Name, err)
    			continue
    		}
    
    		if !bytes.Equal(buf, want.content) {
    			t.Errorf("%v: ReadAll returned unexpected bytes", got.Name)
    		}
    	}
    }
    
    func testCreate(t *testing.T, w *Writer, wt *WriteTest) {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Mon Sep 23 14:32:33 UTC 2024
    - 14.4K bytes
    - Viewed (0)
  4. cmd/naughty-disk_test.go

    	if err := d.calcError(); err != nil {
    		return err
    	}
    	return d.disk.WriteAll(ctx, volume, path, b)
    }
    
    func (d *naughtyDisk) ReadAll(ctx context.Context, volume string, path string) (buf []byte, err error) {
    	if err := d.calcError(); err != nil {
    		return nil, err
    	}
    	return d.disk.ReadAll(ctx, volume, path)
    }
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Aug 12 08:38:15 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  5. internal/config/policy/opa/config.go

    	}
    
    	resp, err := o.client.Do(req)
    	if err != nil {
    		return false, err
    	}
    	defer o.args.CloseRespFn(resp.Body)
    
    	// Read the body to be saved later.
    	opaRespBytes, err := io.ReadAll(resp.Body)
    	if err != nil {
    		return false, err
    	}
    
    	// Handle large OPA responses when OPA URL is of
    	// form http://localhost:8181/v1/data/httpapi/authz
    	type opaResultAllow struct {
    		Result struct {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Jul 10 20:16:44 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  6. cni/pkg/plugin/cnieventclient.go

    	if err != nil {
    		return fmt.Errorf("failed to send event request: %v", err)
    	}
    	defer response.Body.Close()
    
    	if response.StatusCode != http.StatusOK {
    		body, err := io.ReadAll(io.LimitReader(response.Body, 1024*1024))
    		if err != nil {
    			return fmt.Errorf("unable to push CNI event and failed to read body (status code %d): %v", response.StatusCode, err)
    		}
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Tue Jul 02 18:48:50 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  7. internal/s3select/sql/jsonpath_test.go

    		return nil, err
    	}
    	return result, nil
    }
    
    func TestJsonpathEval(t *testing.T) {
    	f, err := os.Open(filepath.Join("jsondata", "books.json"))
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	b, err := io.ReadAll(f)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	p := participle.MustBuild(
    		&JSONPath{},
    		participle.Lexer(sqlLexer),
    		participle.CaseInsensitive("Keyword"),
    	)
    	cases := []struct {
    		str string
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 23 19:35:41 UTC 2024
    - 2.8K bytes
    - Viewed (0)
  8. cni/pkg/log/uds_test.go

    	_ = istiolog.Sync()
    
    	// Restore os stdout.
    	os.Stdout = stdout
    	assert.NoError(t, istiolog.Configure(loggingOptions))
    
    	assert.NoError(t, w.Close())
    	out, err := io.ReadAll(r)
    	assert.NoError(t, err)
    
    	cases := []struct {
    		level string
    		msg   string
    		key   *float64
    	}{
    		{"debug", "debug log", nil},
    		{"info", "info log", nil},
    		{"warn", "warn log", nil},
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Wed Jun 12 16:26:28 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  9. cmd/storage-rest_test.go

    		expectErr      bool
    	}{
    		{"foo", "myobject", []byte("foo"), false},
    		// file not found error.
    		{"foo", "yourobject", nil, true},
    	}
    
    	for i, testCase := range testCases {
    		result, err := storage.ReadAll(context.Background(), testCase.volumeName, testCase.objectName)
    		expectErr := (err != nil)
    
    		if expectErr != testCase.expectErr {
    			t.Fatalf("case %v: error: expected: %v, got: %v", i+1, testCase.expectErr, expectErr)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jul 22 07:04:48 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  10. cmd/admin-bucket-handlers.go

    	bucket := pathClean(vars["bucket"])
    
    	if _, err := objectAPI.GetBucketInfo(ctx, bucket, BucketOptions{}); err != nil {
    		writeErrorResponseJSON(ctx, w, toAPIError(ctx, err), r.URL)
    		return
    	}
    
    	data, err := io.ReadAll(r.Body)
    	if err != nil {
    		writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrInvalidRequest), r.URL)
    		return
    	}
    
    	quotaConfig, err := parseBucketQuota(bucket, data)
    	if err != nil {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Aug 28 15:32:18 UTC 2024
    - 33.2K bytes
    - Viewed (0)
Back to top