pyjnius/tests/test_interface.py

18 lines
511 B
Python
Raw Normal View History

import unittest
from jnius import autoclass, JavaException
class Interface(unittest.TestCase):
def test_reflect_interface(self):
Interface = autoclass('org.jnius.InterfaceWithPublicEnum')
self.assertTrue(Interface)
def test_reflect_enum_in_interface(self):
ATTITUDE = autoclass('org.jnius.InterfaceWithPublicEnum$ATTITUDE')
self.assertTrue(ATTITUDE)
self.assertTrue(ATTITUDE.GOOD)
self.assertTrue(ATTITUDE.BAD)
self.assertTrue(ATTITUDE.UGLY)