def testGetInfo_NotConnected(self): """Test method for ScalarisVM.getInfo() with a closed connection.""" vm = ScalarisVM() vm.close_connection() #self.assertRaises(scalaris.ConnectionError, vm.getInfo()) vm.getInfo() vm.close_connection()
def _testGetOtherVMs(self, maxVMs): """Test method for ScalarisVM.getOtherVMs().""" vm = ScalarisVM() otherVMs = vm.getOtherVMs(maxVMs) self.assertTrue(len(otherVMs) <= maxVMs, "list too long: " + str(otherVMs)) for otherVMUrl in otherVMs: otherVM = ScalarisVM(JSONConnection(otherVMUrl)) otherVM.getInfo() otherVM.close_connection() vm.close_connection()
def _testGetOtherVMs(self, maxVMs): """Test method for ScalarisVM.getOtherVMs().""" vm = ScalarisVM() otherVMs = vm.getOtherVMs(maxVMs) self.assertTrue( len(otherVMs) <= maxVMs, "list too long: " + str(otherVMs)) for otherVMUrl in otherVMs: otherVM = ScalarisVM(JSONConnection(otherVMUrl)) otherVM.getInfo() otherVM.close_connection() vm.close_connection()
def testGetInfo1(self): """Test method for ScalarisVM.getInfo().""" vm = ScalarisVM() info = vm.getInfo() self.assertTrue(isinstance(info.scalarisVersion, basestring), msg=info.scalarisVersion) self.assertTrue(len(info.scalarisVersion) > 0, msg="scalaris_version (" + info.scalarisVersion + ") != \"\"") self.assertTrue(isinstance(info.erlangVersion, basestring), msg=info.erlangVersion) self.assertTrue(len(info.erlangVersion) > 0, msg="erlang_version (" + info.erlangVersion + ") != \"\"") self.assertTrue(isinstance(info.memTotal, int), msg=info.memTotal) self.assertTrue(info.memTotal >= 0, msg="mem_total (" + str(info.memTotal) + ") >= 0") self.assertTrue(isinstance(info.uptime, int), msg=info.uptime) self.assertTrue(info.uptime >= 0, msg="uptime (" + str(info.uptime) + ") >= 0") self.assertTrue(isinstance(info.erlangNode, basestring), msg=info.erlangNode) self.assertTrue(len(info.erlangNode) > 0, msg="erlang_node (" + info.erlangNode + ") != \"\"") self.assertTrue(isinstance(info.port, int), msg=info.port) self.assertTrue(info.port >= 0 and info.port <= 65535, msg="0 <= port (" + str(info.port) + ") <= 65535") self.assertTrue(isinstance(info.yawsPort, int), msg=info.yawsPort) self.assertTrue(info.yawsPort >= 0 and info.yawsPort <= 65535, msg="0 <= yaws_port (" + str(info.yawsPort) + ") <= 65535") vm.close_connection()
def testGetInfo1(self): """Test method for ScalarisVM.getInfo().""" vm = ScalarisVM() info = vm.getInfo() self.assertTrue(isinstance(info.scalarisVersion, basestring), msg = info.scalarisVersion) self.assertTrue(len(info.scalarisVersion) > 0, msg = "scalaris_version (" + info.scalarisVersion + ") != \"\""); self.assertTrue(isinstance(info.erlangVersion, basestring), msg = info.erlangVersion) self.assertTrue(len(info.erlangVersion) > 0, msg = "erlang_version (" + info.erlangVersion + ") != \"\""); self.assertTrue(isinstance(info.memTotal, int), msg = info.memTotal) self.assertTrue(info.memTotal >= 0, msg = "mem_total (" + str(info.memTotal) + ") >= 0"); self.assertTrue(isinstance(info.uptime, int), msg = info.uptime) self.assertTrue(info.uptime >= 0, msg = "uptime (" + str(info.uptime) + ") >= 0"); self.assertTrue(isinstance(info.erlangNode, basestring), msg = info.erlangNode) self.assertTrue(len(info.erlangNode) > 0, msg = "erlang_node (" + info.erlangNode + ") != \"\""); self.assertTrue(isinstance(info.port, int), msg = info.port) self.assertTrue(info.port >= 0 and info.port <= 65535, msg = "0 <= port (" + str(info.port) + ") <= 65535"); self.assertTrue(isinstance(info.yawsPort, int), msg = info.yawsPort) self.assertTrue(info.yawsPort >= 0 and info.yawsPort <= 65535, msg = "0 <= yaws_port (" + str(info.yawsPort) + ") <= 65535"); vm.close_connection()