예제 #1
0
    def test3(self):
        remote = RemoteCodeInterface()

        var = new_plummer_model(100)
        remote.assign("var", var)
        var_ = remote.evaluate("var.mass")
        self.assertEqual(var_, var.mass)
예제 #2
0
 def test3(self):
   remote=RemoteCodeInterface()
   
   var=new_plummer_model(100)
   remote.assign("var",var)
   var_=remote.evaluate("var.mass")
   self.assertEqual(var_,var.mass)
예제 #3
0
    def test1(self):
        remote = RemoteCodeInterface()

        var = 123
        remote.assign("var", var)
        var_ = remote.evaluate("var+1")
        self.assertEqual(var_, var + 1)
        remote.execute("var=var*2")
        var_ = remote.evaluate("var")
        self.assertEqual(var_, var * 2)
예제 #4
0
    def test4(self):
        self.check_not_in_mpiexec()
        remote = RemoteCodeInterface(channel_type="sockets")

        var = 123
        remote.assign("var", var)
        var_ = remote.evaluate("var+1")
        self.assertEqual(var_, var + 1)
        remote.execute("var=var*2")
        var_ = remote.evaluate("var")
        self.assertEqual(var_, var * 2)
예제 #5
0
 def test1(self):
   remote=RemoteCodeInterface()
   
   var=123
   remote.assign("var",var)
   var_=remote.evaluate("var+1")
   self.assertEqual(var_,var+1)
   remote.execute("var=var*2")
   var_=remote.evaluate("var")
   self.assertEqual(var_,var*2)
예제 #6
0
 def test4(self):
   self.check_not_in_mpiexec()
   remote=RemoteCodeInterface(channel_type="sockets")
   
   var=123
   remote.assign("var",var)
   var_=remote.evaluate("var+1")
   self.assertEqual(var_,var+1)
   remote.execute("var=var*2")
   var_=remote.evaluate("var")
   self.assertEqual(var_,var*2)
예제 #7
0
 def test2(self):
   remote=RemoteCodeInterface()
   
   from math import sqrt
   result=remote.func(sqrt, 64)
   self.assertEqual(result,8)
예제 #8
0
    def test2(self):
        remote = RemoteCodeInterface()

        from math import sqrt
        result = remote.func(sqrt, 64)
        self.assertEqual(result, 8)