pyjnius/tests/test_simple.py

17 lines
494 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
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(JavaClass, metaclass=MetaJavaClass):
__javaclass__ = 'org/jnius/HelloWorld'
hello = JavaMethod('()Ljava/lang/String;')
a = HelloWorld()
self.assertEqual(a.hello(), 'world')