diff --git a/_examples/simple/test.py b/_examples/simple/test.py new file mode 100644 index 0000000..5fd3d0f --- /dev/null +++ b/_examples/simple/test.py @@ -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() + diff --git a/main_test.go b/main_test.go index b69cc8f..849b000 100644 --- a/main_test.go +++ b/main_test.go @@ -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()... +`), + }) +}