Beispiel #1
0
 def testStart(self):
     self.cli = MockCLI()
     c = NodeControl(omeroDir, self.cli)
     self.assert_(c._likes(None))
     self.assert_(c._likes("start"))
     c("start")
     self.assert_(self.cli.called == 1)
     c("start")
     self.assert_(self.cli.called == 2)
Beispiel #2
0
 def testStart(self):
     self.cli = MockCLI()
     c = NodeControl(omeroDir, self.cli)
     self.assert_(c._likes(None))
     self.assert_(c._likes("start"))
     c("start")
     self.assert_(self.cli.called == 1)
     c("start")
     self.assert_(self.cli.called == 2)
Beispiel #3
0
    def testKill(self):
        self.cli = MockCLI()

        p = subprocess.Popen(["sleep", "100"])

        c = NodeControl(omeroDir, self.cli)
        f = file(c._pid(), "w")
        f.write(str(p.pid))
        f.close()
        c("kill")
        c.kill()
Beispiel #4
0
    def testKill(self):
        self.cli = MockCLI()

        p = subprocess.Popen(["sleep","100"])

        c = NodeControl(omeroDir, self.cli)
        f = file(c._pid(),"w")
        f.write(str(p.pid))
        f.close()
        c("kill")
        c.kill()
Beispiel #5
0
 def testStop(self):
     self.cli = MockCLI()
     c = NodeControl(omeroDir, self.cli)
     c("stop")
     c.stop()
Beispiel #6
0
 def testStop(self):
     self.cli = MockCLI()
     c = NodeControl(omeroDir, self.cli)
     c("stop")
     c.stop()
Beispiel #7
0
"""

import unittest, os, subprocess, StringIO
from path import path
from omero.plugins.node import NodeControl
from omero.cli import Context
from clitest.mocks import MockCLI

omeroDir = path(os.getcwd()) / "build"
etcDir = omeroDir / "etc"
try:
    etcDir.makedirs()
except:
    pass

hostCfg = path(etcDir / NodeControl(None,None)._node()) + ".cfg"
hostCfg.write_text("IceGrid.Node.Data=var/TEST_DIRECTORY")


class TestNode(unittest.TestCase):

    def testStart(self):
        self.cli = MockCLI()
        c = NodeControl(omeroDir, self.cli)
        self.assert_(c._likes(None))
        self.assert_(c._likes("start"))
        c("start")
        self.assert_(self.cli.called == 1)
        c("start")
        self.assert_(self.cli.called == 2)