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