Tests: more fixtures.

Common methods from applications/proto.py converted to the fixtures.
sysctl check moved to the specific file where it is using.
Some options moved to the constructor to have early access.
This commit is contained in:
Andrei Zeliankou
2023-05-29 16:45:49 +01:00
parent f55818059c
commit 31ff94add9
24 changed files with 340 additions and 341 deletions

View File

@@ -4,7 +4,6 @@ import time
import pytest
from unit.applications.lang.java import TestApplicationJava
from unit.applications.websockets import TestApplicationWebsocket
from unit.option import option
class TestJavaWebsockets(TestApplicationJava):
@@ -1241,7 +1240,7 @@ class TestJavaWebsockets(TestApplicationJava):
self.ws.frame_write(sock, self.ws.OP_CLOSE, payload)
self.check_close(sock, 1002)
def test_java_websockets_9_1_1__9_6_6(self, is_unsafe):
def test_java_websockets_9_1_1__9_6_6(self, is_unsafe, system):
if not is_unsafe:
pytest.skip('unsafe, long run')
@@ -1298,7 +1297,7 @@ class TestJavaWebsockets(TestApplicationJava):
check_payload(op_binary, 8 * 2**20) # 9_2_5
check_payload(op_binary, 16 * 2**20) # 9_2_6
if option.system != 'Darwin' and option.system != 'FreeBSD':
if system not in ['Darwin', 'FreeBSD']:
check_message(op_text, 64) # 9_3_1
check_message(op_text, 256) # 9_3_2
check_message(op_text, 2**10) # 9_3_3