-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patherror_test.go
More file actions
36 lines (31 loc) · 865 Bytes
/
error_test.go
File metadata and controls
36 lines (31 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package py
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestPyError(t *testing.T) {
Convey("When importing builtins module and extract SyntaxError type", t, func() {
mdl, err := loadExceptionModule()
So(err, ShouldBeNil)
So(mdl, ShouldNotBeNil)
Reset(func() {
mdl.Release()
})
syntaxError, err := mdl.GetClass("SyntaxError")
So(err, ShouldBeNil)
Reset(func() {
syntaxError.Release()
})
Convey("applying isSyntaxError to SyntaxError should return true.", func() {
So(isSyntaxError(syntaxError.p), ShouldBeTrue)
})
environmentError, err := mdl.GetClass("EnvironmentError")
So(err, ShouldBeNil)
Reset(func() {
environmentError.Release()
})
Convey("applying isSyntaxError to EnvironmentError should return false.", func() {
So(isSyntaxError(environmentError.p), ShouldBeFalse)
})
})
}