'make sure connection close sends correct frames'

def test_on_connection_closed(self):

    method_frame = mock.Mock()
    method_frame.method = mock.Mock(spec=spec.Connection.Close)
    method_frame.method.reply_code = 1
    method_frame.method.reply_text = 'hello'
    self.connection._on_terminate = mock.Mock()
    self.connection._on_connection_close(method_frame)
    self.connection._on_terminate.assert_called_once_with(1, 'hello')
