Debian Codegraph @

test/jpypetest/test_customizer.py

raw symbols SCIP
1 # *****************************************************************************
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 #
15 # See NOTICE file for details.
16 #
17 # *****************************************************************************
18 import _jpype
19 import jpype
20 from jpype.types import *
21 from jpype import java
22 import common
23 try:
24 import numpy as np
25 except ImportError:
26 pass
27
28
29 class CustomizerTestCase(common.JPypeTestCase):
30 def setUp(self):
31 common.JPypeTestCase.setUp(self)
32 self.fixture = JClass('jpype.common.Fixture')()
33
34 def testSticky(self):
35 @jpype.JImplementationFor("jpype.override.A")
36 class _A:
37 @jpype.JOverride(sticky=True, rename="remove_")
38 def remove(self, obj):
39 pass
40
41 A = jpype.JClass("jpype.override.A")
42 B = jpype.JClass("jpype.override.B")
43 self.assertEqual(A.remove, _A.remove)
44 self.assertEqual(B.remove, _A.remove)
45 self.assertEqual(str(A.remove_), "jpype.override.A.remove")
46 self.assertEqual(str(B.remove_), "jpype.override.B.remove")