Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 4,620 for Jest (0.15 sec)

  1. docs_src/app_testing/app_b/test_main.py

    from .main import app
    
    client = TestClient(app)
    
    
    def test_read_item():
        response = client.get("/items/foo", headers={"X-Token": "coneofsilence"})
        assert response.status_code == 200
        assert response.json() == {
            "id": "foo",
            "title": "Foo",
            "description": "There goes my hero",
        }
    
    
    def test_read_item_bad_token():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  2. 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)
  3. tests/test_tutorial/test_request_files/test_tutorial003.py

                files=(
                    ("files", ("test.txt", file)),
                    ("files", ("test2.txt", file2)),
                ),
            )
        assert response.status_code == 200, response.text
        assert response.json() == {"file_sizes": [14, 15]}
    
    
    def test_post_upload_file(tmp_path):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
        path2 = tmp_path / "test2.txt"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 7.1K bytes
    - Viewed (0)
  4. istioctl/pkg/writer/envoy/configdump/secret_test.go

    	"io"
    	"os"
    	"testing"
    
    	"istio.io/istio/pkg/test/util/assert"
    )
    
    func TestSDSWriter_ValidCert(t *testing.T) {
    	configDumpFile, err := os.Open("testdata/secret/config_dump.json")
    	if err != nil {
    		t.Errorf("error opening test data file: %v", err)
    	}
    	defer configDumpFile.Close()
    	configDump, err := io.ReadAll(configDumpFile)
    	if err != nil {
    		t.Errorf("error reading test data file: %v", err)
    	}
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Jun 06 15:14:48 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  5. tests/test_annotated.py

        assert response.json() == {"foo": "baz"}
    
    
    def test_nested_router():
        app = FastAPI()
    
        router = APIRouter(prefix="/nested")
    
        @router.get("/test")
        async def test(var: Annotated[str, Query()] = "bar"):
            return {"foo": var}
    
        app.include_router(router)
    
        client = TestClient(app)
    
        response = client.get("/nested/test")
        assert response.status_code == 200
    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)
  6. 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)
  7. istioctl/pkg/proxyconfig/proxyconfig_test.go

    	"strings"
    	"testing"
    
    	"github.com/spf13/cobra"
    	"k8s.io/cli-runtime/pkg/resource"
    	"k8s.io/client-go/rest/fake"
    	cmdtesting "k8s.io/kubectl/pkg/cmd/testing"
    	cmdutil "k8s.io/kubectl/pkg/cmd/util"
    
    	"istio.io/istio/istioctl/pkg/cli"
    	"istio.io/istio/pilot/test/util"
    	"istio.io/istio/pkg/kube"
    	"istio.io/istio/pkg/test/util/assert"
    )
    
    type execTestCase struct {
    	execClientConfig map[string][]byte
    	args             []string
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Wed Apr 10 21:51:29 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  8. cni/pkg/install/cniconfig_test.go

    package install
    
    import (
    	"context"
    	"os"
    	"path/filepath"
    	"testing"
    	"time"
    
    	"istio.io/istio/cni/pkg/config"
    	testutils "istio.io/istio/pilot/test/util"
    	"istio.io/istio/pkg/file"
    	"istio.io/istio/pkg/test/util/assert"
    )
    
    func TestGetDefaultCNINetwork(t *testing.T) {
    	tempDir := t.TempDir()
    
    	cases := []struct {
    		name            string
    		dir             string
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Wed May 17 02:22:22 GMT 2023
    - 15.4K bytes
    - Viewed (0)
  9. internal/event/arn_test.go

    		data, err := xml.Marshal(testCase.arn)
    		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.8K bytes
    - Viewed (0)
  10. .github/workflows/test-redistribute.yml

    name: Test Redistribute
    
    on:
      push:
        branches:
          - master
      pull_request:
        types:
          - opened
          - synchronize
    
    jobs:
      test-redistribute:
        runs-on: ubuntu-latest
        steps:
          - name: Dump GitHub context
            env:
              GITHUB_CONTEXT: ${{ toJson(github) }}
            run: echo "$GITHUB_CONTEXT"
          - uses: actions/checkout@v4
          - name: Set up Python
    Others
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 28 23:28:07 GMT 2024
    - 1.4K bytes
    - Viewed (0)
Back to top