Skip to content

Commit

Permalink
Test wala#211.
Browse files Browse the repository at this point in the history
  • Loading branch information
khatchad committed Jul 22, 2024
1 parent 4c5aea5 commit 3eeebb5
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2934,6 +2934,41 @@ public void testModule74()
new int[] {2});
}

/** Test https://github.com/wala/ML/issues/211. */
@Test(expected = AssertionError.class)
public void testModule75()
throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
test(
new String[] {"proj71/src/__init__.py", "proj71/src/module.py", "proj71/src/client.py"},
"src/module.py",
"f",
"proj71",
1,
1,
new int[] {2});
}

/** Test https://github.com/wala/ML/issues/211. */
@Test
public void testModule76()
throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
test(new String[] {"module.py", "client.py"}, "module.py", "f", "", 1, 1, new int[] {2});
}

/** Test https://github.com/wala/ML/issues/211. */
@Test
public void testModule77()
throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
test(
new String[] {"proj72/src/__init__.py", "proj72/src/module.py", "proj72/src/client.py"},
"src/module.py",
"f",
"proj72",
1,
1,
new int[] {2});
}

@Test
public void testStaticMethod() throws ClassHierarchyException, CancelException, IOException {
test("tf2_test_static_method.py", "MyClass.the_static_method", 1, 1, 2);
Expand Down
2 changes: 2 additions & 0 deletions com.ibm.wala.cast.python.test/.pydevproject
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@
<path>/${PROJECT_DIR_NAME}/data/proj68</path>
<path>/${PROJECT_DIR_NAME}/data/proj69</path>
<path>/${PROJECT_DIR_NAME}/data/proj70</path>
<path>/${PROJECT_DIR_NAME}/data/proj71</path>
<path>/${PROJECT_DIR_NAME}/data/proj72</path>
</pydev_pathproperty>
</pydev_project>
6 changes: 6 additions & 0 deletions com.ibm.wala.cast.python.test/data/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Test https://github.com/wala/ML/issues/211.

from tensorflow import ones
import module

module.f(ones([1, 2]))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Test https://github.com/wala/ML/issues/211.

import tensorflow as tf


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

6 changes: 6 additions & 0 deletions com.ibm.wala.cast.python.test/data/proj71/src/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Test https://github.com/wala/ML/issues/211.

from tensorflow import ones
import module

module.f(ones([1, 2]))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/proj71/src/module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Test https://github.com/wala/ML/issues/211.

import tensorflow as tf


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

6 changes: 6 additions & 0 deletions com.ibm.wala.cast.python.test/data/proj72/src/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Test https://github.com/wala/ML/issues/211.

from tensorflow import ones
from module import f

f(ones([1, 2]))
7 changes: 7 additions & 0 deletions com.ibm.wala.cast.python.test/data/proj72/src/module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Test https://github.com/wala/ML/issues/211.

import tensorflow as tf


def f(a):
assert isinstance(a, tf.Tensor)

0 comments on commit 3eeebb5

Please sign in to comment.