Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-amqp for openSUSE:Factory 
checked in at 2022-03-26 22:32:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-amqp (Old)
 and      /work/SRC/openSUSE:Factory/.python-amqp.new.1900 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-amqp"

Sat Mar 26 22:32:17 2022 rev:40 rq:965088 version:5.1.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-amqp/python-amqp.changes  2022-01-05 
13:39:40.913522243 +0100
+++ /work/SRC/openSUSE:Factory/.python-amqp.new.1900/python-amqp.changes        
2022-03-26 22:32:41.718087486 +0100
@@ -1,0 +2,12 @@
+Sat Mar 26 20:22:44 UTC 2022 - Dirk M??ller <dmuel...@suse.com>
+
+- update to 5.1.0:
+  - Improve performance of _get_free_channel_id, fix channel max bug (#385).
+  - Document memoryview usage, minor frame_writer.write_frame refactor (#384).
+  - Start dropping python 3.6 (#387).
+  - Added experimental __slots__ to some classes (#368)
+  - Relaxed vine version for upcoming release.
+  - Upgraded topytest 7 (#388).
+- drop vine-no-double-equals-deps.patch (upstream)
+
+-------------------------------------------------------------------

Old:
----
  amqp-5.0.9.tar.gz
  vine-no-double-equals-deps.patch

New:
----
  amqp-5.1.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-amqp.spec ++++++
--- /var/tmp/diff_new_pack.lM1D8c/_old  2022-03-26 22:32:42.274088247 +0100
+++ /var/tmp/diff_new_pack.lM1D8c/_new  2022-03-26 22:32:42.282088258 +0100
@@ -19,13 +19,12 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-amqp
-Version:        5.0.9
+Version:        5.1.0
 Release:        0
 Summary:        Low-level AMQP client for Python (fork of amqplib)
 License:        LGPL-2.1-or-later
-URL:            http://github.com/celery/py-amqp
+URL:            https://github.com/celery/py-amqp
 Source:         
https://files.pythonhosted.org/packages/source/a/amqp/amqp-%{version}.tar.gz
-Patch0:         vine-no-double-equals-deps.patch
 BuildRequires:  %{python_module case >= 1.3.1}
 BuildRequires:  %{python_module pytest >= 3.0}
 BuildRequires:  %{python_module setuptools}
@@ -44,7 +43,6 @@
 
 %prep
 %setup -q -n amqp-%{version}
-%autopatch -p1
 # requires internet connection:
 rm t/integration/test_rmq.py
 

++++++ amqp-5.0.9.tar.gz -> amqp-5.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/Changelog new/amqp-5.1.0/Changelog
--- old/amqp-5.0.9/Changelog    2021-12-20 05:48:13.000000000 +0100
+++ new/amqp-5.1.0/Changelog    2022-03-06 04:59:33.000000000 +0100
@@ -6,6 +6,21 @@
 http://code.google.com/p/py-amqplib/source/browse/CHANGES
 
 
+.. _version-5.1.0:
+
+5.1.0
+=====
+:release-date: 2022-03-06 10:05 A.M. UTC+6:00
+:release-by: Asif Saif Uddin
+
+- Improve performance of _get_free_channel_id, fix channel max bug (#385).
+- Document memoryview usage, minor frame_writer.write_frame refactor (#384).
+- Start dropping python 3.6 (#387).
+- Added experimental __slots__ to some classes (#368)
+- Relaxed vine version for upcoming release.
+- Upgraded topytest 7 (#388).
+
+
 .. _version-5.0.9:
 
 5.0.9
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/PKG-INFO new/amqp-5.1.0/PKG-INFO
--- old/amqp-5.0.9/PKG-INFO     2021-12-20 05:51:47.183409500 +0100
+++ new/amqp-5.1.0/PKG-INFO     2022-03-06 05:07:19.775380000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: amqp
-Version: 5.0.9
+Version: 5.1.0
 Summary: Low-level AMQP client for Python (fork of amqplib).
 Home-page: http://github.com/celery/py-amqp
 Author: Barry Pederson
@@ -13,7 +13,6 @@
 Classifier: Programming Language :: Python
 Classifier: Programming Language :: Python :: 3 :: Only
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.6
 Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
@@ -33,7 +32,7 @@
 
 |build-status| |coverage| |license| |wheel| |pyversion| |pyimp|
 
-:Version: 5.0.9
+:Version: 5.1.0
 :Web: https://amqp.readthedocs.io/
 :Download: https://pypi.org/project/amqp/
 :Source: http://github.com/celery/py-amqp/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/README.rst new/amqp-5.1.0/README.rst
--- old/amqp-5.0.9/README.rst   2021-12-20 05:50:13.000000000 +0100
+++ new/amqp-5.1.0/README.rst   2022-03-06 05:03:12.000000000 +0100
@@ -4,7 +4,7 @@
 
 |build-status| |coverage| |license| |wheel| |pyversion| |pyimp|
 
-:Version: 5.0.9
+:Version: 5.1.0
 :Web: https://amqp.readthedocs.io/
 :Download: https://pypi.org/project/amqp/
 :Source: http://github.com/celery/py-amqp/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/amqp/__init__.py 
new/amqp-5.1.0/amqp/__init__.py
--- old/amqp-5.0.9/amqp/__init__.py     2021-12-20 05:49:38.000000000 +0100
+++ new/amqp-5.1.0/amqp/__init__.py     2022-03-06 05:01:47.000000000 +0100
@@ -4,7 +4,7 @@
 import re
 from collections import namedtuple
 
-__version__ = '5.0.9'
+__version__ = '5.1.0'
 __author__ = 'Barry Pederson'
 __maintainer__ = 'Asif Saif Uddin, Matus Valo'
 __contact__ = 'pya...@celeryproject.org'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/amqp/abstract_channel.py 
new/amqp-5.1.0/amqp/abstract_channel.py
--- old/amqp-5.0.9/amqp/abstract_channel.py     2021-12-12 06:39:32.000000000 
+0100
+++ new/amqp-5.1.0/amqp/abstract_channel.py     2022-03-01 09:38:14.000000000 
+0100
@@ -39,6 +39,19 @@
 
         self._setup_listeners()
 
+    __slots__ = (
+        "is_closing",
+        "connection",
+        "channel_id",
+        "method_queue",
+        "auto_decode",
+        "_pending",
+        "_callbacks",
+        # adding '__dict__' to get dynamic assignment
+        "__dict__",
+        "__weakref__",
+        )
+
     def __enter__(self):
         return self
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/amqp/basic_message.py 
new/amqp-5.1.0/amqp/basic_message.py
--- old/amqp-5.0.9/amqp/basic_message.py        2021-12-12 06:39:32.000000000 
+0100
+++ new/amqp-5.1.0/amqp/basic_message.py        2022-03-01 09:38:14.000000000 
+0100
@@ -107,6 +107,12 @@
         self.body = body
         self.channel = channel
 
+    __slots__ = (
+        "delivery_info",
+        "body",
+        "channel",
+        )
+
     @property
     def headers(self):
         return self.properties.get('application_headers')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/amqp/channel.py 
new/amqp-5.1.0/amqp/channel.py
--- old/amqp-5.0.9/amqp/channel.py      2021-12-17 04:55:58.000000000 +0100
+++ new/amqp-5.1.0/amqp/channel.py      2022-03-01 09:38:14.000000000 +0100
@@ -122,6 +122,18 @@
         if self.connection.confirm_publish:
             self.basic_publish = self.basic_publish_confirm
 
+        __slots__ = (
+        "is_open",
+        "active",
+        "returned_messages",
+        "callbacks",
+        "cancel_callbacks",
+        "events",
+        "no_ack_consumers",
+        "on_open",
+        "_confirm_selected",
+        )
+
     def then(self, on_success, on_error=None):
         return self.on_open.then(on_success, on_error)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/amqp/connection.py 
new/amqp-5.1.0/amqp/connection.py
--- old/amqp-5.0.9/amqp/connection.py   2021-12-20 05:37:58.000000000 +0100
+++ new/amqp-5.1.0/amqp/connection.py   2021-12-29 05:40:57.000000000 +0100
@@ -482,8 +482,11 @@
         self._transport = self.connection = self.channels = None
 
     def _get_free_channel_id(self):
-        for channel_id in range(1, self.channel_max):
-            if channel_id not in self._used_channel_ids:
+        # Cast to a set for fast lookups, and keep stored as an array for 
lower memory usage.
+        used_channel_ids = set(self._used_channel_ids)
+
+        for channel_id in range(1, self.channel_max + 1):
+            if channel_id not in used_channel_ids:
                 self._used_channel_ids.append(channel_id)
                 return channel_id
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/amqp/method_framing.py 
new/amqp-5.1.0/amqp/method_framing.py
--- old/amqp-5.0.9/amqp/method_framing.py       2021-11-18 13:04:22.000000000 
+0100
+++ new/amqp-5.1.0/amqp/method_framing.py       2021-12-29 05:40:57.000000000 
+0100
@@ -94,6 +94,9 @@
     @buf.setter
     def buf(self, buf):
         self._buf = buf
+        # Using a memoryview allows slicing without copying underlying data.
+        # Slicing this is much faster than slicing the bytearray directly.
+        # More details: https://stackoverflow.com/a/34257357
         self.view = memoryview(buf)
 
 
@@ -107,13 +110,6 @@
 
     def write_frame(type_, channel, method_sig, args, content):
         chunk_size = connection.frame_max - 8
-        # frame_max can be updated via connection._on_tune. If
-        # it became larger, then we need to resize the buffer
-        # to prevent overflow.
-        if chunk_size > len(buffer_store.buf):
-            buffer_store.buf = bytearray(chunk_size)
-        buf = buffer_store.buf
-        view = buffer_store.view
         offset = 0
         properties = None
         args = str_to_bytes(args)
@@ -155,6 +151,13 @@
                                frame, 0xce))
 
         else:
+            # frame_max can be updated via connection._on_tune. If
+            # it became larger, then we need to resize the buffer
+            # to prevent overflow.
+            if chunk_size > len(buffer_store.buf):
+                buffer_store.buf = bytearray(chunk_size)
+            buf = buffer_store.buf
+
             # ## FAST: pack into buffer and single write
             frame = (b''.join([pack('>HH', *method_sig), args])
                      if type_ == 1 else b'')
@@ -180,7 +183,7 @@
                               3, channel, framelen, body, 0xce)
                     offset += 8 + framelen
 
-            write(view[:offset])
+            write(buffer_store.view[:offset])
 
         connection.bytes_sent += 1
     return write_frame
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/amqp/sasl.py new/amqp-5.1.0/amqp/sasl.py
--- old/amqp-5.0.9/amqp/sasl.py 2021-12-12 06:39:32.000000000 +0100
+++ new/amqp-5.1.0/amqp/sasl.py 2022-03-01 09:38:14.000000000 +0100
@@ -34,6 +34,11 @@
     def __init__(self, username, password):
         self.username, self.password = username, password
 
+    __slots__ = (
+        "username",
+        "password",
+        )
+
     def start(self, connection):
         if self.username is None or self.password is None:
             return NotImplemented
@@ -56,6 +61,11 @@
     def __init__(self, username, password):
         self.username, self.password = username, password
 
+    __slots__ = (
+        "username",
+        "password",
+        )
+
     def start(self, connection):
         if self.username is None or self.password is None:
             return NotImplemented
@@ -104,6 +114,13 @@
                 self.service = service
                 self.rdns = rdns
 
+            __slots__ = (
+                "client_name",
+                "fail_soft",
+                "service",
+                "rdns"
+                )
+
             def get_hostname(self, connection):
                 sock = connection.transport.sock
                 if self.rdns and sock.family in (socket.AF_INET,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/amqp/serialization.py 
new/amqp-5.1.0/amqp/serialization.py
--- old/amqp-5.0.9/amqp/serialization.py        2021-12-12 06:39:32.000000000 
+0100
+++ new/amqp-5.1.0/amqp/serialization.py        2022-03-01 09:38:14.000000000 
+0100
@@ -488,6 +488,19 @@
         self.body_size = 0
         self.ready = False
 
+    __slots__ = (
+        "frame_method",
+        "frame_args",
+        "properties",
+        "_pending_chunks",
+        "body_received",
+        "body_size",
+        "ready",
+        # adding '__dict__' to get dynamic assignment
+        "__dict__",
+        "__weakref__",
+        )
+
     def __getattr__(self, name):
         # Look for additional properties in the 'properties'
         # dictionary, and if present - the 'delivery_info' dictionary.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/amqp/transport.py 
new/amqp-5.1.0/amqp/transport.py
--- old/amqp-5.0.9/amqp/transport.py    2021-12-17 04:55:58.000000000 +0100
+++ new/amqp-5.1.0/amqp/transport.py    2022-03-01 09:38:14.000000000 +0100
@@ -97,6 +97,22 @@
         self.write_timeout = write_timeout
         self.socket_settings = socket_settings
 
+    __slots__ = (
+        "connection",
+        "sock",
+        "raise_on_initial_eintr",
+        "_read_buffer",
+        "host",
+        "port",
+        "connect_timeout",
+        "read_timeout",
+        "write_timeout",
+        "socket_settings",
+        # adding '__dict__' to get dynamic assignment
+        "__dict__",
+        "__weakref__",
+        )
+
     def __repr__(self):
         if self.sock:
             src = f'{self.sock.getsockname()[0]}:{self.sock.getsockname()[1]}'
@@ -410,6 +426,10 @@
         super().__init__(
             host, connect_timeout=connect_timeout, **kwargs)
 
+    __slots__ = (
+        "sslopts",
+        )
+
     def _setup_transport(self):
         """Wrap the socket in an SSL object."""
         self.sock = self._wrap_socket(self.sock, **self.sslopts)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/amqp.egg-info/PKG-INFO 
new/amqp-5.1.0/amqp.egg-info/PKG-INFO
--- old/amqp-5.0.9/amqp.egg-info/PKG-INFO       2021-12-20 05:51:47.000000000 
+0100
+++ new/amqp-5.1.0/amqp.egg-info/PKG-INFO       2022-03-06 05:07:19.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: amqp
-Version: 5.0.9
+Version: 5.1.0
 Summary: Low-level AMQP client for Python (fork of amqplib).
 Home-page: http://github.com/celery/py-amqp
 Author: Barry Pederson
@@ -13,7 +13,6 @@
 Classifier: Programming Language :: Python
 Classifier: Programming Language :: Python :: 3 :: Only
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.6
 Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
@@ -33,7 +32,7 @@
 
 |build-status| |coverage| |license| |wheel| |pyversion| |pyimp|
 
-:Version: 5.0.9
+:Version: 5.1.0
 :Web: https://amqp.readthedocs.io/
 :Download: https://pypi.org/project/amqp/
 :Source: http://github.com/celery/py-amqp/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/amqp.egg-info/requires.txt 
new/amqp-5.1.0/amqp.egg-info/requires.txt
--- old/amqp-5.0.9/amqp.egg-info/requires.txt   2021-12-20 05:51:47.000000000 
+0100
+++ new/amqp-5.1.0/amqp.egg-info/requires.txt   2022-03-06 05:07:19.000000000 
+0100
@@ -1 +1 @@
-vine==5.0.0
+vine>=5.0.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/docs/includes/introduction.txt 
new/amqp-5.1.0/docs/includes/introduction.txt
--- old/amqp-5.0.9/docs/includes/introduction.txt       2021-12-20 
05:50:00.000000000 +0100
+++ new/amqp-5.1.0/docs/includes/introduction.txt       2022-03-06 
05:02:24.000000000 +0100
@@ -1,4 +1,4 @@
-:Version: 5.0.9
+:Version: 5.1.0
 :Web: https://amqp.readthedocs.io/
 :Download: https://pypi.org/project/amqp/
 :Source: http://github.com/celery/py-amqp/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/requirements/default.txt 
new/amqp-5.1.0/requirements/default.txt
--- old/amqp-5.0.9/requirements/default.txt     2021-11-18 09:18:39.000000000 
+0100
+++ new/amqp-5.1.0/requirements/default.txt     2022-03-06 04:54:37.000000000 
+0100
@@ -1 +1 @@
-vine==5.0.0
+vine>=5.0.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/requirements/test.txt 
new/amqp-5.1.0/requirements/test.txt
--- old/amqp-5.0.9/requirements/test.txt        2021-12-19 05:48:27.000000000 
+0100
+++ new/amqp-5.1.0/requirements/test.txt        2022-03-06 04:54:37.000000000 
+0100
@@ -1,3 +1,3 @@
-pytest>=6.2.5,<=7.0.0
+pytest>=6.2.5,<=8.0.0
 pytest-sugar>=0.9.1
 pytest-rerunfailures>=6.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/setup.py new/amqp-5.1.0/setup.py
--- old/amqp-5.0.9/setup.py     2021-12-19 05:50:47.000000000 +0100
+++ new/amqp-5.1.0/setup.py     2022-01-10 14:07:20.000000000 +0100
@@ -17,7 +17,6 @@
     Programming Language :: Python
     Programming Language :: Python :: 3 :: Only
     Programming Language :: Python :: 3
-    Programming Language :: Python :: 3.6
     Programming Language :: Python :: 3.7
     Programming Language :: Python :: 3.8
     Programming Language :: Python :: 3.9
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/t/integration/test_integration.py 
new/amqp-5.1.0/t/integration/test_integration.py
--- old/amqp-5.0.9/t/integration/test_integration.py    2021-11-18 
09:18:39.000000000 +0100
+++ new/amqp-5.1.0/t/integration/test_integration.py    2021-12-29 
05:40:57.000000000 +0100
@@ -1,4 +1,5 @@
 import socket
+from array import array
 from struct import pack
 from unittest.mock import ANY, Mock, call, patch
 
@@ -415,6 +416,17 @@
                 )
                 callback_mock.assert_called_once_with()
 
+    def test_send_heartbeat(self):
+        """The send_heartbeat method writes the expected output."""
+        conn = Connection()
+        with patch.object(conn, 'Transport') as transport_mock:
+            handshake(conn, transport_mock)
+            transport_mock().write.reset_mock()
+            conn.send_heartbeat()
+            transport_mock().write.assert_called_once_with(
+                memoryview(bytearray(b'\x08\x00\x00\x00\x00\x00\x00\xce'))
+            )
+
 
 class test_channel:
     # Integration tests. Tests verify the correctness of communication between
@@ -534,9 +546,11 @@
             frame_writer_mock.reset_mock()
 
             on_open_mock = Mock()
+            assert conn._used_channel_ids == array('H')
             ch = conn.channel(channel_id=channel_id, callback=on_open_mock)
             on_open_mock.assert_called_once_with(ch)
             assert ch.is_open is True
+            assert conn._used_channel_ids == array('H', (1,))
 
             ch.close()
             frame_writer_mock.assert_has_calls(
@@ -552,6 +566,7 @@
                 ]
             )
             assert ch.is_open is False
+            assert conn._used_channel_ids == array('H')
 
     def test_received_channel_Close_during_connection_close(self):
         # This test verifies that library handles correctly closing channel
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/t/unit/test_connection.py 
new/amqp-5.1.0/t/unit/test_connection.py
--- old/amqp-5.0.9/t/unit/test_connection.py    2021-12-20 05:37:58.000000000 
+0100
+++ new/amqp-5.1.0/t/unit/test_connection.py    2021-12-29 05:40:57.000000000 
+0100
@@ -352,8 +352,10 @@
         assert self.conn._get_free_channel_id() == 1
         assert self.conn._get_free_channel_id() == 2
 
-    def test_get_free_channel_id__raises_IndexError(self):
-        self.conn._used_channel_ids = array('H', range(1, 
self.conn.channel_max))
+    def test_get_free_channel_id__raises_ResourceError(self):
+        self.conn.channel_max = 2
+        self.conn._get_free_channel_id()
+        self.conn._get_free_channel_id()
         with pytest.raises(ResourceError):
             self.conn._get_free_channel_id()
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/amqp-5.0.9/t/unit/test_method_framing.py 
new/amqp-5.1.0/t/unit/test_method_framing.py
--- old/amqp-5.0.9/t/unit/test_method_framing.py        2021-11-18 
09:18:39.000000000 +0100
+++ new/amqp-5.1.0/t/unit/test_method_framing.py        2021-12-29 
05:40:57.000000000 +0100
@@ -138,11 +138,24 @@
         assert 'body'.encode('utf-16') in memory.tobytes()
         assert msg.properties['content_encoding'] == 'utf-16'
 
-    def test_frame_max_update(self):
-        msg = Message(body='t' * (self.connection.frame_max + 10))
-        frame = 2, 1, spec.Basic.Publish, b'x' * 10, msg
+    def test_write_frame__fast__buffer_store_resize(self):
+        """The buffer_store is resized when the connection's frame_max is 
increased."""
+        small_msg = Message(body='t')
+        small_frame = 2, 1, spec.Basic.Publish, b'x' * 10, small_msg
+        self.g(*small_frame)
+        self.write.assert_called_once()
+        write_arg = self.write.call_args[0][0]
+        assert isinstance(write_arg, memoryview)
+        assert len(write_arg) < self.connection.frame_max
+        self.connection.reset_mock()
+
+        # write a larger message to the same frame_writer after increasing 
frame_max
+        large_msg = Message(body='t' * (self.connection.frame_max + 10))
+        large_frame = 2, 1, spec.Basic.Publish, b'x' * 10, large_msg
+        original_frame_max = self.connection.frame_max
         self.connection.frame_max += 100
-        self.g(*frame)
-        self.write.assert_called()
-        memory = self.write.call_args[0][0]
-        assert isinstance(memory, memoryview)
+        self.g(*large_frame)
+        self.write.assert_called_once()
+        write_arg = self.write.call_args[0][0]
+        assert isinstance(write_arg, memoryview)
+        assert len(write_arg) > original_frame_max

Reply via email to