@@ -239,13 +239,13 @@ def test_key_info():
239
239
assert polyglot .__key_info__ (o , "my_field" , "modifiable" )
240
240
assert polyglot .__key_info__ (o , "my_field" , "removable" )
241
241
assert not polyglot .__key_info__ (o , "my_field" , "insertable" )
242
-
242
+
243
243
assert polyglot .__key_info__ (o , "__getattribute__" , "readable" )
244
244
assert polyglot .__key_info__ (o , "__getattribute__" , "invokable" )
245
245
assert not polyglot .__key_info__ (o , "__getattribute__" , "modifiable" )
246
246
assert not polyglot .__key_info__ (o , "__getattribute__" , "removable" )
247
247
assert not polyglot .__key_info__ (o , "__getattribute__" , "insertable" )
248
-
248
+
249
249
builtinObj = (1 ,2 ,3 )
250
250
assert polyglot .__key_info__ (builtinObj , "__len__" , "readable" )
251
251
assert polyglot .__key_info__ (builtinObj , "__len__" , "invokable" )
@@ -297,7 +297,7 @@ def test_direct_call_of_truffle_object_methods():
297
297
assert False , "calling the python equivalents for well-known functions directly should work"
298
298
except NotImplementedError as e :
299
299
assert "host lookup is not allowed" in str (e )
300
-
300
+
301
301
def test_array_element_info ():
302
302
immutableObj = (1 ,2 ,3 ,4 )
303
303
assert polyglot .__element_info__ (immutableObj , 0 , "exists" )
@@ -316,3 +316,18 @@ def test_array_element_info():
316
316
assert not polyglot .__element_info__ (mutableObj , 0 , "insertable" )
317
317
assert polyglot .__element_info__ (mutableObj , 0 , "modifiable" )
318
318
assert polyglot .__element_info__ (mutableObj , 4 , "insertable" )
319
+
320
+ def test_java_imports ():
321
+ import java
322
+ try :
323
+ al = java .type ("java.util.ArrayList" )()
324
+ except NotImplementedError as e :
325
+ assert "host lookup is not allowed" in str (e )
326
+ else :
327
+ import java .util .ArrayList
328
+ assert repr (java .util .ArrayList ()) == "[]"
329
+
330
+ from java .util import ArrayList
331
+ assert repr (ArrayList ()) == "[]"
332
+
333
+ assert java .util .ArrayList == ArrayList
0 commit comments