mirror of
https://github.com/thp/pyotherside.git
synced 2025-02-05 08:08:23 +08:00
Add getattr() and callMethod() tests to test_wrapped
This commit is contained in:
parent
cc7bc11595
commit
4619b95040
@ -4,6 +4,10 @@ class Foo(object):
|
||||
def __init__(self, name):
|
||||
print('new Foo(', name, ')')
|
||||
self.name = name
|
||||
self.bar = 4711
|
||||
|
||||
def methodman(self, something):
|
||||
return 'I came to bring {}'.format(something)
|
||||
|
||||
def __del__(self):
|
||||
print('__del__ called on', self.name)
|
||||
|
@ -16,6 +16,12 @@ Rectangle {
|
||||
var foo = call_sync('test_wrapped.get_foo', []);
|
||||
console.log('got foo: ' + foo);
|
||||
|
||||
console.log('attribute bar of foo: ' + getattr(foo, 'bar'));
|
||||
|
||||
callMethod(foo, 'methodman', ['the pain'], function (result) {
|
||||
console.log('methodman() result: ' + result);
|
||||
});
|
||||
|
||||
var result = call_sync('test_wrapped.set_foo', [foo]);
|
||||
console.log('got result: ' + result);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user