bind: add test for 'simple' package

Change-Id: If0bd1c6ba29d4916990c756bec25e2e80da94c6d
This commit is contained in:
Sebastien Binet 2015-08-10 15:38:06 +02:00
parent 73f11b29bb
commit 73845d817e
2 changed files with 30 additions and 0 deletions

17
_examples/simple/test.py Normal file
View File

@ -0,0 +1,17 @@
# Copyright 2015 The go-python Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
## py2/py3 compat
from __future__ import print_function
import simple as pkg
print("doc(pkg):\n%s" % repr(pkg.__doc__))
print("pkg.Func()...")
pkg.Func()
print("fct = pkg.Func...")
fct = pkg.Func
print("fct()...")
fct()

View File

@ -212,3 +212,16 @@ s2.F1() = None
`), `),
}) })
} }
func TestBindSimple(t *testing.T) {
t.Parallel()
testPkg(t, pkg{
path: "_examples/simple",
want: []byte(`doc(pkg):
'simple is a simple package.\n'
pkg.Func()...
fct = pkg.Func...
fct()...
`),
})
}