Skip to content

Commit

Permalink
BlitzGateway.connect: test raiseOnError
Browse files Browse the repository at this point in the history
  • Loading branch information
manics committed Apr 8, 2020
1 parent 7080f9f commit d68e639
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/unit/test_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit d68e639

Please sign in to comment.