Repository: OpenMined/PySyft
Pull request: Added test with send in plan
Test for plans using `send`.

Closes #2539 

Problem statement:
Test send operation inside a plan
Make tests for using send inside a plan, the test will be something like:

```python
@sy.func2plan([th.Size((2,3))])
def plan_double_abs(x):
    x = x.send(bob)
    x = x + x
    x = th.abs(x)
    return x

ptr_result = plan_double_abs(th.zeros(3))
assert type(ptr_result, sy.PointerTensor)
result = ptr_result.get()
assert torch.equal(result, th.tensor([2., 2., 2.]))
```

Hints from issue discussion:

Commit message: Added test with send in plan

Patch to review:
diff --git a/.gitignore b/.gitignore
index 37a338b6333..c210fdfbe52 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,3 +20,6 @@ docs/_modules
 .vscode/
 **/pip-wheel-metadata
 
+# IDE specific
+out/
+*.iml
diff --git a/test/message/test_plan.py b/test/message/test_plan.py
index 08e08c9e575..136d71f3e8d 100644
--- a/test/message/test_plan.py
+++ b/test/message/test_plan.py
@@ -8,14 +8,10 @@
 from syft.serde.serde import deserialize
 from syft.serde.serde import serialize
 from syft import messaging
-import time
 
 import pytest
 import unittest.mock as mock
 
-from syft.workers import WebsocketClientWorker
-from syft.workers import WebsocketServerWorker
-
 
 def test_plan_built_automatically(hook):
     # To run a plan locally the local worker can't be a client worker,
@@ -531,3 +527,20 @@ def test__call__for_method(hook):
 
     # reset function
     sy.ID_PROVIDER.pop = pop_function_original
+
+
+def test_send_with_plan(workers):
+    bob = workers["bob"]
+
+    @sy.func2plan([th.Size((1, 3))])
+    def plan_double_abs(x):
+        x = x.send(bob)
+        x = x + x
+        x = th.abs(x)
+        return x
+
+    expected = th.tensor([4.0, 4.0, 4.0])
+    ptr_result = plan_double_abs(th.tensor([-2.0, 2.0, 2.0]))
+    assert isinstance(ptr_result.child, sy.PointerTensor)
+    result = ptr_result.get()
+    assert th.equal(result, expected)


Code review comments:
diff_hunk: @@ -20,3 +20,6 @@ docs/_modules
 .vscode/
 **/pip-wheel-metadata
 
+# IDE specific
path: .gitignore
text: @user1:
This is not related to the PR. Can you remove these changes?

@author:
Done