mirror of https://github.com/kivy/pyjnius.git
16 lines
458 B
Python
16 lines
458 B
Python
import unittest
|
|
from jnius import autoclass, JavaException
|
|
|
|
|
|
class AssignableFrom(unittest.TestCase):
|
|
|
|
def test_assignable(self):
|
|
ArrayList = autoclass('java.util.ArrayList')
|
|
Object = autoclass('java.lang.Object')
|
|
|
|
a = ArrayList()
|
|
# addAll accept Collection, Object must failed
|
|
self.assertRaises(JavaException, a.addAll, Object())
|
|
# while adding another ArrayList must be ok.
|
|
a.addAll(ArrayList())
|