From d68e639b52d3b583d12c65164f3edcd0b813a4bb Mon Sep 17 00:00:00 2001 From: Simon Li Date: Wed, 8 Apr 2020 15:10:11 +0100 Subject: [PATCH] BlitzGateway.connect: test raiseOnError --- test/unit/test_gateway.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/unit/test_gateway.py b/test/unit/test_gateway.py index 3f34480ca..4d3d0363e 100644 --- a/test/unit/test_gateway.py +++ b/test/unit/test_gateway.py @@ -360,3 +360,19 @@ def test_simple_marshal_not_tiled(self, wrapped_image): data = wrapped_image.simpleMarshal(xtra={'tiled': True}) self.assert_data(data) assert data['tiled'] is False + + +class TestBlitzGatewayConnect(object): + + def test_connect_default(self): + conn = BlitzGateway( + host='this.host.does.not.exist.example.org', + username='username', passwd='passwd') + assert conn.connect() == False + + def test_connect_raise(self): + conn = BlitzGateway( + host='this.host.does.not.exist.example.org', + username='username', passwd='passwd') + with pytest.raises(Ice.DNSException): + conn.connect(raiseOnError=True)