pyjnius/tests/test_simple.py

18 lines
531 B
Python
Raw Normal View History

from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import unittest
2012-08-14 01:42:43 +00:00
from jnius import JavaClass, MetaJavaClass, JavaMethod
2015-11-04 22:30:24 +00:00
from six import with_metaclass
2012-08-14 01:42:43 +00:00
class HelloWorldTest(unittest.TestCase):
2012-08-14 01:42:43 +00:00
def test_helloworld(self):
2012-08-14 01:42:43 +00:00
class HelloWorld(with_metaclass(MetaJavaClass, JavaClass)):
__javaclass__ = 'org/jnius/HelloWorld'
hello = JavaMethod('()Ljava/lang/String;')
a = HelloWorld()
self.assertEqual(a.hello(), 'world')