Skip to content

Commit

Permalink
Addded a test for creating a channel when the connection is closed.
Browse files Browse the repository at this point in the history
  • Loading branch information
thedrow committed Sep 11, 2019
1 parent a797885 commit 115285c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions t/unit/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,12 @@ def test_channel(self):
c2 = self.conn.channel(3, callback)
assert c2 is c

def test_channel_when_connection_is_closed(self):
self.conn.collect()
callback = Mock(name='callback')
with pytest.raises(RecoverableConnectionError):
self.conn.channel(3, callback)

def test_is_alive(self):
with pytest.raises(NotImplementedError):
self.conn.is_alive()
Expand Down

0 comments on commit 115285c

Please sign in to comment.