diff --git a/edu.cuny.hunter.hybridize.tests/.pydevproject b/edu.cuny.hunter.hybridize.tests/.pydevproject index 2b045655f..6f1664c13 100644 --- a/edu.cuny.hunter.hybridize.tests/.pydevproject +++ b/edu.cuny.hunter.hybridize.tests/.pydevproject @@ -2,4 +2,7 @@ Default python interpreter + + /${PROJECT_DIR_NAME}/resources/HybridizeFunction/testModule2/in/src + diff --git a/edu.cuny.hunter.hybridize.tests/HybridizeFunctionRefactoringTest.testModule.launch b/edu.cuny.hunter.hybridize.tests/HybridizeFunctionRefactoringTest.testModule.launch new file mode 100644 index 000000000..0f9599dfd --- /dev/null +++ b/edu.cuny.hunter.hybridize.tests/HybridizeFunctionRefactoringTest.testModule.launch @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/edu.cuny.hunter.hybridize.tests/HybridizeFunctionRefactoringTest.testModule2.launch b/edu.cuny.hunter.hybridize.tests/HybridizeFunctionRefactoringTest.testModule2.launch new file mode 100644 index 000000000..f5f27ea31 --- /dev/null +++ b/edu.cuny.hunter.hybridize.tests/HybridizeFunctionRefactoringTest.testModule2.launch @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testModule2/in/requirements.txt b/edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testModule2/in/requirements.txt new file mode 100644 index 000000000..b154f958f --- /dev/null +++ b/edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testModule2/in/requirements.txt @@ -0,0 +1 @@ +tensorflow==2.9.3 diff --git a/edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testModule2/in/src/A.py b/edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testModule2/in/src/A.py new file mode 100644 index 000000000..725e37ccb --- /dev/null +++ b/edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testModule2/in/src/A.py @@ -0,0 +1,4 @@ +from tensorflow import ones +from src.B import f + +f(ones([1, 2])) diff --git a/edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testModule2/in/src/B.py b/edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testModule2/in/src/B.py new file mode 100644 index 000000000..7d2e7e6c2 --- /dev/null +++ b/edu.cuny.hunter.hybridize.tests/resources/HybridizeFunction/testModule2/in/src/B.py @@ -0,0 +1,5 @@ +from tensorflow import Tensor + + +def f(a): + assert isinstance(a, Tensor) diff --git a/edu.cuny.hunter.hybridize.tests/test cases/edu/cuny/hunter/hybridize/tests/HybridizeFunctionRefactoringTest.java b/edu.cuny.hunter.hybridize.tests/test cases/edu/cuny/hunter/hybridize/tests/HybridizeFunctionRefactoringTest.java index a7cbc1b3f..392507a5b 100644 --- a/edu.cuny.hunter.hybridize.tests/test cases/edu/cuny/hunter/hybridize/tests/HybridizeFunctionRefactoringTest.java +++ b/edu.cuny.hunter.hybridize.tests/test cases/edu/cuny/hunter/hybridize/tests/HybridizeFunctionRefactoringTest.java @@ -7002,6 +7002,18 @@ public void testModule() throws Exception { } } + @Test + public void testModule2() throws Exception { + Set functions = this.getFunctions("src/B"); + assertEquals(1, functions.size()); + + for (Function function : functions) { + assertEquals("f", function.getIdentifier()); + assertEquals(1, function.getNumberOfParameters()); + assertTrue(function.getLikelyHasTensorParameter()); + } + } + /** * True iff the input test Python file should be executed. */