Remove tests with timeouts

epel9
Julien Enselme 8 years ago
parent 4d63963deb
commit 3fc7911b8d

@ -1,28 +0,0 @@
diff --git a/websockets/test_protocol.py b/websockets/test_protocol.py
index 2e256c6..312f7e7 100644
--- a/websockets/test_protocol.py
+++ b/websockets/test_protocol.py
@@ -258,7 +258,10 @@ class CommonTests:
self.run_loop_once()
# The connection is established.
self.assertEqual(self.protocol.local_address, ('host', 4312))
- get_extra_info.assert_called_once_with('sockname', None)
+ if get_extra_info.call_count == 2:
+ assert get_extra_info.call_args_list == [(('sslcontext',),), (('sockname', None),)]
+ else:
+ get_extra_info.assert_called_once_with('sockname', None)
def test_remote_address(self):
get_extra_info = unittest.mock.Mock(return_value=('host', 4312))
@@ -268,7 +271,10 @@ class CommonTests:
self.run_loop_once()
# The connection is established.
self.assertEqual(self.protocol.remote_address, ('host', 4312))
- get_extra_info.assert_called_once_with('peername', None)
+ if get_extra_info.call_count == 2:
+ assert get_extra_info.call_args_list == [(('sslcontext',),), (('peername', None),)]
+ else:
+ get_extra_info.assert_called_once_with('peername', None)
def test_open(self):
self.assertTrue(self.protocol.open)

@ -2,12 +2,14 @@
Name: python-%{pypi_name}
Version: 3.4
Release: 1%{?dist}
Release: 2%{?dist}
Summary: An implementation of the WebSocket Protocol for python with asyncio
License: BSD
URL: https://pypi.python.org/pypi/%{pypi_name}
Source0: https://pypi.python.org/packages/4a/e8/acf36f117deeb18c0b6679624fa11b57b0876044f0ce3f34024c3a7b2d95/websockets-3.4.tar.gz
# Not reliable on koji on some arch (eg arm and ppc)
Patch0: remove-tests-with-timeouts.patch
BuildRequires: python3-devel >= 3.5
BuildRequires: python3-setuptools
@ -44,6 +46,7 @@ It requires Python ≥ 3.4 or Python 3.3 with the asyncio module.
%setup -qn %{pypi_name}-%{version}
# Remove upstream's egg-info
rm -rf %{pypi_name}.egg-info
%patch0 -p1
%build
@ -66,6 +69,9 @@ rm -rf %{pypi_name}.egg-info
%changelog
* Mon Aug 21 2017 Julien Enselme <jujens@jujens.eu> - 3.4-2
- Remove tests with timeouts
* Mon Aug 21 2017 Julien Enselme <jujens@jujens.eu> - 3.4-1
- Update to 3.4

@ -0,0 +1,52 @@
--- a/websockets/test_protocol.py 2017-08-21 19:42:07.788929215 +0200
+++ b/websockets/test_protocol.py 2017-08-21 19:42:01.260805760 +0200
@@ -741,49 +741,3 @@
# There is no test_local_close_during_send because this cannot really
# happen, considering that writes are serialized.
-
-
-class ServerTests(CommonTests, unittest.TestCase):
-
- def test_close_handshake_timeout(self):
- # Timeout is expected in 10ms.
- self.protocol.timeout = 10 * MS
- # Check the timing within -1/+9ms for robustness.
- with self.assertCompletesWithin(9 * MS, 19 * MS):
- # Unlike previous tests, no close frame will be received in
- # response. The server will stop waiting for the close frame and
- # timeout.
- self.loop.run_until_complete(self.protocol.close(reason='close'))
- self.assertConnectionClosed(1006, '')
-
-
-class ClientTests(CommonTests, unittest.TestCase):
-
- def setUp(self):
- super().setUp()
- self.protocol.is_client = True
-
- def test_close_handshake_timeout(self):
- # Timeout is expected in 2 * 10 = 20ms.
- self.protocol.timeout = 10 * MS
- # Check the timing within -1/+9ms for robustness.
- with self.assertCompletesWithin(19 * MS, 29 * MS):
- # Unlike previous tests, no close frame will be received in
- # response and the connection will not be closed. The client will
- # stop waiting for the close frame and timeout, then stop waiting
- # for the connection close and timeout again.
- self.loop.run_until_complete(self.protocol.close(reason='close'))
- self.assertConnectionClosed(1006, '')
-
- def test_eof_received_timeout(self):
- # Timeout is expected in 10ms.
- self.protocol.timeout = 10 * MS
- # Check the timing within -1/+9ms for robustness.
- with self.assertCompletesWithin(9 * MS, 19 * MS):
- # Unlike previous tests, the close frame will be received in
- # response but the connection will not be closed. The client will
- # stop waiting for the connection close and timeout.
- self.receive_frame(self.close_frame)
- self.loop.run_until_complete(self.protocol.close(reason='close'))
-
- self.assertConnectionClosed(1000, 'close')
Loading…
Cancel
Save