'make sure _on_connection_close_ok terminates connection'

def test_on_connection_close_ok(self):

    method_frame = mock.Mock()
    method_frame.method = mock.Mock(spec=spec.Connection.CloseOk)
    self.connection.closing = (1, 'bye')
    self.connection._on_terminate = mock.Mock()
    self.connection._on_connection_close_ok(method_frame)
    self.connection._on_terminate.assert_called_once_with(1, 'bye')
