Skip to content

Commit 5546ccd

Browse files
committed
py: failing test for IsSubtype
1 parent 0d4a6d4 commit 5546ccd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

py/type_test.go

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package py
2+
3+
import "testing"
4+
5+
func TestIsSubType(t *testing.T) {
6+
for _, test := range []struct {
7+
a *Type
8+
b *Type
9+
want bool
10+
}{
11+
{ValueError, ValueError, true},
12+
{ValueError, ExceptionType, true},
13+
{ExceptionType, ValueError, false},
14+
} {
15+
got := test.a.IsSubtype(test.b)
16+
if test.want != got {
17+
t.Errorf("%v.IsSubtype(%v) want %v got %v", test.a.Name, test.b.Name, test.want, got)
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)