pyjnius/tests/test_reflect.py

17 lines
490 B
Python

from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import unittest
from jnius.reflect import autoclass
class ReflectTest(unittest.TestCase):
def test_stack(self):
Stack = autoclass('java.util.Stack')
stack = Stack()
self.assertIsInstance(stack, Stack)
stack.push('hello')
stack.push('world')
self.assertEqual(stack.pop(), 'world')
self.assertEqual(stack.pop(), 'hello')