예제 #1
0
class HostIsUpAndRunningHandlerTestCase(unittest.TestCase):
    def setUp(self):
        FakeSocket.reset()
        self.handler = HostIsUpAndRunningHandler("hostname", 80)
        self.handler._socket = FakeSocket

    def test_run_ok(self):
        FakeSocket.expected_action = FakeSocket.OK
        self.handler.run()

    def test_run_error(self):
        FakeSocket.expected_action = FakeSocket.ERROR
        self.assertRaises(LaboratoryErrors.UnableToConnectHostnameInPortError,
                          self.handler.run)
class HostIsUpAndRunningHandlerTestCase(unittest.TestCase):

    def setUp(self):
        FakeSocket.reset()
        self.handler = HostIsUpAndRunningHandler("hostname", 80)
        self.handler._socket = FakeSocket

    def test_run_ok(self):
        FakeSocket.expected_action = FakeSocket.OK
        self.handler.run()

    def test_run_error(self):
        FakeSocket.expected_action = FakeSocket.ERROR
        self.assertRaises(
            LaboratoryErrors.UnableToConnectHostnameInPortError,
            self.handler.run
        )
 def setUp(self):
     FakeSocket.reset()
     self.handler = HostIsUpAndRunningHandler("hostname", 80)
     self.handler._socket = FakeSocket
예제 #4
0
 def setUp(self):
     FakeSocket.reset()
     self.handler = HostIsUpAndRunningHandler("hostname", 80)
     self.handler._socket = FakeSocket