Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 4,546 for test (0.26 sec)

  1. tests/test_tutorial/test_custom_response/test_tutorial009b.py

    from docs_src.custom_response.tutorial009b import app
    
    client = TestClient(app)
    
    
    def test_get(tmp_path: Path):
        file_path: Path = tmp_path / "large-video-file.mp4"
        tutorial009b.some_file_path = str(file_path)
        test_content = b"Fake video bytes"
        file_path.write_bytes(test_content)
        response = client.get("/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Jul 03 19:51:28 GMT 2021
    - 490 bytes
    - Viewed (0)
  2. internal/event/targetid_test.go

    		data, err := testCase.tid.MarshalJSON()
    		expectErr := (err != nil)
    
    		if expectErr != testCase.expectErr {
    			t.Fatalf("test %v: error: expected: %v, got: %v", i+1, testCase.expectErr, expectErr)
    		}
    
    		if !testCase.expectErr {
    			if !reflect.DeepEqual(data, testCase.expectedData) {
    				t.Fatalf("test %v: data: expected: %v, got: %v", i+1, string(testCase.expectedData), string(data))
    			}
    		}
    	}
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 3.5K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_security/test_tutorial006.py

    from docs_src.security.tutorial006 import app
    
    client = TestClient(app)
    
    
    def test_security_http_basic():
        response = client.get("/users/me", auth=("john", "secret"))
        assert response.status_code == 200, response.text
        assert response.json() == {"username": "john", "password": "secret"}
    
    
    def test_security_http_basic_no_credentials():
        response = client.get("/users/me")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  4. istioctl/pkg/workload/workload_test.go

    	"github.com/spf13/cobra"
    	v1 "k8s.io/api/core/v1"
    	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    
    	"istio.io/istio/istioctl/pkg/cli"
    	"istio.io/istio/pilot/test/util"
    	"istio.io/istio/pkg/config/constants"
    	"istio.io/istio/pkg/kube"
    	"istio.io/istio/pkg/test/util/assert"
    )
    
    var fakeCACert = []byte("fake-CA-cert")
    
    var (
    	defaultYAML = `apiVersion: networking.istio.io/v1alpha3
    kind: WorkloadGroup
    metadata:
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Wed Mar 27 16:59:05 GMT 2024
    - 14.6K bytes
    - Viewed (0)
  5. internal/bucket/versioning/versioning_test.go

    			excluded: false,
    		},
    	}
    
    	for i, test := range tests {
    		if v.PrefixSuspended(test.prefix) != test.excluded {
    			if test.excluded {
    				t.Fatalf("Test %d: Expected prefix %s to be excluded from versioning", i+1, test.prefix)
    			} else {
    				t.Fatalf("Test %d: Expected prefix %s to have versioning enabled", i+1, test.prefix)
    			}
    		}
    	}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun May 08 05:06:44 GMT 2022
    - 8.8K bytes
    - Viewed (0)
  6. istioctl/pkg/util/handlers/handlers_test.go

    	"k8s.io/apimachinery/pkg/runtime/schema"
    	corev1client "k8s.io/client-go/kubernetes/typed/core/v1"
    	"k8s.io/client-go/rest/fake"
    	cmdtesting "k8s.io/kubectl/pkg/cmd/testing"
    	"k8s.io/kubectl/pkg/scheme"
    
    	"istio.io/istio/pkg/test/util/assert"
    )
    
    func TestInferPodInfo(t *testing.T) {
    	tests := []struct {
    		proxyName     string
    		namespace     string
    		wantPodName   string
    		wantNamespace string
    	}{
    		{
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Jun 09 18:17:49 GMT 2023
    - 6.6K bytes
    - Viewed (0)
  7. tests/test_annotated.py

            ("/unrelated", 422, foo_is_missing),
        ],
    )
    def test_get(path, expected_status, expected_response):
        response = client.get(path)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    def test_multiple_path():
        app = FastAPI()
    
        @app.get("/test1")
        @app.get("/test2")
        async def test(var: Annotated[str, Query()] = "bar"):
            return {"foo": var}
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  8. tests/tracer_test.go

    package tests_test
    
    import (
    	"context"
    	"time"
    
    	"gorm.io/gorm/logger"
    )
    
    type Tracer struct {
    	Logger logger.Interface
    	Test   func(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error)
    }
    
    func (S Tracer) LogMode(level logger.LogLevel) logger.Interface {
    	return S.Logger.LogMode(level)
    }
    
    func (S Tracer) Info(ctx context.Context, s string, i ...interface{}) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Oct 18 09:28:06 GMT 2022
    - 830 bytes
    - Viewed (0)
  9. src/cmd/asm/internal/asm/line_test.go

    func testBadInstParser(t *testing.T, goarch string, tests []badInstTest) {
    	for i, test := range tests {
    		arch, ctxt := setArch(goarch)
    		tokenizer := lex.NewTokenizer("", strings.NewReader(test.input+"\n"), nil)
    		parser := NewParser(ctxt, arch, tokenizer)
    
    		err := tryParse(t, func() {
    			parser.Parse()
    		})
    
    		switch {
    		case err == nil:
    			t.Errorf("#%d: %q: want error %q; have none", i, test.input, test.error)
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Tue Aug 29 07:48:38 GMT 2023
    - 1.9K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_settings/test_app02.py

    from ...utils import needs_pydanticv2
    
    
    @needs_pydanticv2
    def test_settings(monkeypatch: MonkeyPatch):
        from docs_src.settings.app02 import main
    
        monkeypatch.setenv("ADMIN_EMAIL", "******@****.***")
        settings = main.get_settings()
        assert settings.app_name == "Awesome API"
        assert settings.items_per_user == 50
    
    
    @needs_pydanticv2
    def test_override_settings():
        from docs_src.settings.app02 import test_main
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 488 bytes
    - Viewed (0)
Back to top