Skip to content

Commit

Permalink
test: update strict subset match test
Browse files Browse the repository at this point in the history
Signed-off-by: mao3267 <[email protected]>
  • Loading branch information
mao3267 committed Nov 15, 2024
1 parent 56623e3 commit b8f38a7
Showing 1 changed file with 44 additions and 45 deletions.
89 changes: 44 additions & 45 deletions flytepropeller/pkg/compiler/validators/typing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -832,9 +832,8 @@ func TestMapCasting(t *testing.T) {
a: int
@dataclass
class A:
a: int
b: Optional[str]
class B(A):
b: Optional[str] = None
*/
castable := AreTypesCastable(
&core.LiteralType{
Expand All @@ -851,7 +850,7 @@ func TestMapCasting(t *testing.T) {
},
},
"title": &structpb.Value{
Kind: &structpb.Value_StringValue{StringValue: "A"},
Kind: &structpb.Value_StringValue{StringValue: "B"},
},
"properties": &structpb.Value{
Kind: &structpb.Value_StructValue{
Expand All @@ -868,6 +867,47 @@ func TestMapCasting(t *testing.T) {
},
},
},
"b": {
Kind: &structpb.Value_StructValue{
StructValue: &structpb.Struct{
Fields: map[string]*structpb.Value{
"default": {
Kind: &structpb.Value_NullValue{},
},
"anyOf": {
Kind: &structpb.Value_ListValue{
ListValue: &structpb.ListValue{
Values: []*structpb.Value{
{
Kind: &structpb.Value_StructValue{
StructValue: &structpb.Struct{
Fields: map[string]*structpb.Value{
"type": {
Kind: &structpb.Value_StringValue{StringValue: "string"},
},
},
},
},
},
{
Kind: &structpb.Value_StructValue{
StructValue: &structpb.Struct{
Fields: map[string]*structpb.Value{
"type": {
Kind: &structpb.Value_StringValue{StringValue: "null"},
},
},
},
},
},
},
},
},
},
},
},
},
},
},
},
},
Expand Down Expand Up @@ -912,47 +952,6 @@ func TestMapCasting(t *testing.T) {
},
},
},
"b": {
Kind: &structpb.Value_StructValue{
StructValue: &structpb.Struct{
Fields: map[string]*structpb.Value{
"default": {
Kind: &structpb.Value_NullValue{},
},
"anyOf": {
Kind: &structpb.Value_ListValue{
ListValue: &structpb.ListValue{
Values: []*structpb.Value{
{
Kind: &structpb.Value_StructValue{
StructValue: &structpb.Struct{
Fields: map[string]*structpb.Value{
"type": {
Kind: &structpb.Value_StringValue{StringValue: "string"},
},
},
},
},
},
{
Kind: &structpb.Value_StructValue{
StructValue: &structpb.Struct{
Fields: map[string]*structpb.Value{
"type": {
Kind: &structpb.Value_StringValue{StringValue: "null"},
},
},
},
},
},
},
},
},
},
},
},
},
},
},
},
},
Expand Down

0 comments on commit b8f38a7

Please sign in to comment.