Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for TestBadJSONRejection (0.18 sec)

  1. pkg/api/testing/serialization_test.go

    				t.Fatalf("Time stamps do not match")
    			}
    		}
    	}
    }
    
    // TestBadJSONRejection establishes that a JSON object without a kind or with
    // an unknown kind will not be decoded without error.
    func TestBadJSONRejection(t *testing.T) {
    	badJSONMissingKind := []byte(`{ }`)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Sep 25 11:04:08 UTC 2023
    - 19.3K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/codec_test.go

    	}
    	if _, ok := obj2.(*runtimetesting.TestType1); !ok {
    		t.Fatalf("Got wrong type")
    	}
    	if !semantic.DeepEqual(obj2, tt) {
    		t.Errorf("Expected:\n %#v,\n Got:\n %#v", tt, obj2)
    	}
    }
    
    func TestBadJSONRejection(t *testing.T) {
    	log.SetOutput(os.Stderr)
    	_, codec := GetTestScheme()
    	badJSONs := [][]byte{
    		[]byte(`{"myVersionKey":"v1"}`),                          // Missing kind
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:46:12 UTC 2023
    - 13.2K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/runtime/scheme_test.go

    		emptyObj.SetGroupVersionKind(schema.GroupVersionKind{Kind: "Test", Version: "v1"})
    		if _, _, err := scheme.ObjectKinds(emptyObj); err != nil {
    			t.Errorf("unexpected error: %v", err)
    		}
    	})
    }
    
    func TestBadJSONRejection(t *testing.T) {
    	scheme := runtime.NewScheme()
    	codecs := serializer.NewCodecFactory(scheme)
    	info, _ := runtime.SerializerInfoForMediaType(codecs.SupportedMediaTypes(), runtime.ContentTypeJSON)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:48:03 UTC 2023
    - 38.2K bytes
    - Viewed (0)
Back to top