Skip to content

Commit

Permalink
Add test for wala#202.
Browse files Browse the repository at this point in the history
  • Loading branch information
khatchad committed Jul 10, 2024
1 parent 2e46029 commit 769494b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2704,6 +2704,20 @@ public void testModule60()
new int[] {2});
}

/** Test https://github.com/wala/ML/issues/202. */
@Test
public void testModule61()
throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
test(
new String[] {"proj56/src/__init__.py", "proj56/src/B.py", "proj56/A.py"},
"src/B.py",
"C.f",
"proj56",
1,
1,
new int[] {3});
}

@Test
public void testStaticMethod() throws ClassHierarchyException, CancelException, IOException {
test("tf2_test_static_method.py", "MyClass.the_static_method", 1, 1, 2);
Expand Down
1 change: 1 addition & 0 deletions com.ibm.wala.cast.python.test/.pydevproject
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
<path>/${PROJECT_DIR_NAME}/data/proj51</path>
<path>/${PROJECT_DIR_NAME}/data/proj52</path>
<path>/${PROJECT_DIR_NAME}/data/proj55</path>
<path>/${PROJECT_DIR_NAME}/data/proj56</path>
</pydev_pathproperty>
</pydev_project>
13 changes: 13 additions & 0 deletions com.ibm.wala.cast.python.test/data/proj56/A.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Test https://github.com/wala/ML/issues/163.

from tensorflow import ones
from src import C


class D:

def __init__(self):
C().f(ones([1, 2]))


D()
9 changes: 9 additions & 0 deletions com.ibm.wala.cast.python.test/data/proj56/src/B.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Test https://github.com/wala/ML/issues/163.

from tensorflow import Tensor


class C:

def f(self, a):
assert isinstance(a, Tensor)
1 change: 1 addition & 0 deletions com.ibm.wala.cast.python.test/data/proj56/src/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .B import C

0 comments on commit 769494b

Please sign in to comment.