From 73845d817e5e65eda564f1977034f465da421d1f Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Mon, 10 Aug 2015 15:38:06 +0200 Subject: [PATCH] bind: add test for 'simple' package Change-Id: If0bd1c6ba29d4916990c756bec25e2e80da94c6d --- _examples/simple/test.py | 17 +++++++++++++++++ main_test.go | 13 +++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 _examples/simple/test.py 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()... +`), + }) +}