nova/nova/tests/unit/console
melanie witt f6bacd3fde Refactor and rename test_tcp_rst_no_compute_rpcapi
The NovaProxyRequestHandlerTestCase.test_tcp_rst_no_compute_rpcapi test
fails with mock==4.0.2 because mock is calling the
NovaProxyRequestHandler class's compute_rpcapi @property while creating
mock autospecs. The test asserts that the @property is not called when
a TCP RST is received, so mock calling the @property itself causes the
test to fail erroneously.

This is also the case in the built-in unittest.mock in python 3.8 [1].

We can refactor (and rename) this unit test to more concisely test the
desired behavior when TCP RST or otherwise unvalidated requests are
handled by the console proxy request handler. This has the benefit of
(1) making the test work with mock==4.0.2 and python 3.8 and (2)
removing unnecessary dependency and potentially incorrect assumptions
about the internal details of websockify.

Closes-Bug: #1887735

[1] https://bugs.python.org/issue41768

Change-Id: I58b0382c86d4ef798572edb63d311e0e3e6937bb
2021-02-03 23:15:06 +00:00
..
rfb Fix accumulated nits 2018-01-16 14:54:04 +00:00
securityproxy Remove six.text_type (2/2) 2020-12-13 11:26:35 +00:00
__init__.py move all tests to nova/tests/unit 2014-11-12 15:31:08 -05:00
test_serial.py Remove six.moves 2020-11-07 03:25:02 +00:00
test_type.py Make unit tests inherit from test.NoDBTestCase 2015-03-06 09:46:31 +02:00
test_websocketproxy.py Refactor and rename test_tcp_rst_no_compute_rpcapi 2021-02-03 23:15:06 +00:00