From 0b85fe29f7e49c88cab88aa9303d5885fa9c9dd5 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Wed, 8 Nov 2023 18:37:02 +0000 Subject: Tests: 8XXX used as default port range. After the launch of the project, the testing infrastructure was shared with nginx project in some cases. To avoid port overlap, a decision was made to shift the port range for Unit tests. This problem was resolved a long time ago and is no longer relevant, so it is now safe to use port 8XXX range as the default, as it is more appropriate for testing purposes. --- test/test_ruby_application.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/test_ruby_application.py') diff --git a/test/test_ruby_application.py b/test/test_ruby_application.py index 6f533b70..f187cc45 100644 --- a/test/test_ruby_application.py +++ b/test/test_ruby_application.py @@ -91,7 +91,7 @@ def test_ruby_application_server_port(): client.load('server_port') assert ( - client.get()['headers']['Server-Port'] == '7080' + client.get()['headers']['Server-Port'] == '8080' ), 'Server-Port header' -- cgit From 8fbe437ca690d92a6d75b1d5314b5aa3bf8787b9 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Fri, 17 Nov 2023 17:28:44 +0000 Subject: Tests: Ruby input.rewind is no longer required. For more information see: https://github.com/rack/rack/commit/42aff22f708123839ba706cbe659d108b47c40c7 --- test/test_ruby_application.py | 9 --------- 1 file changed, 9 deletions(-) (limited to 'test/test_ruby_application.py') diff --git a/test/test_ruby_application.py b/test/test_ruby_application.py index f187cc45..fb161c61 100644 --- a/test/test_ruby_application.py +++ b/test/test_ruby_application.py @@ -163,15 +163,6 @@ def test_ruby_application_input_each(): assert client.post(body=body)['body'] == body, 'input each' -@pytest.mark.skip('not yet') -def test_ruby_application_input_rewind(): - client.load('input_rewind') - - body = '0123456789' - - assert client.post(body=body)['body'] == body, 'input rewind' - - @pytest.mark.skip('not yet') def test_ruby_application_syntax_error(skip_alert): skip_alert( -- cgit From 0fc5232107e8701dc0d1f2a6008e2dbecb73293b Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Fri, 17 Nov 2023 17:28:52 +0000 Subject: Tests: added more expected Ruby features. --- test/test_ruby_application.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/test_ruby_application.py') diff --git a/test/test_ruby_application.py b/test/test_ruby_application.py index fb161c61..3ac62f71 100644 --- a/test/test_ruby_application.py +++ b/test/test_ruby_application.py @@ -315,6 +315,20 @@ def test_ruby_application_header_rack(): assert client.get()['status'] == 500, 'header rack' +@pytest.mark.skip('not yet') +def test_ruby_application_session(): + client.load('session') + + assert client.get()['status'] == 200 + + +@pytest.mark.skip('not yet') +def test_ruby_application_multipart(): + client.load('multipart') + + assert client.get()['status'] == 200 + + def test_ruby_application_body_empty(): client.load('body_empty') -- cgit From 5a8337933df1cf3aba967d86549e236dd9173386 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Mon, 15 Jan 2024 15:48:58 +0000 Subject: Tests: pathlib used where appropriate Also fixed various pylint errors and style issues. --- test/test_ruby_application.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test/test_ruby_application.py') diff --git a/test/test_ruby_application.py b/test/test_ruby_application.py index 3ac62f71..aae89999 100644 --- a/test/test_ruby_application.py +++ b/test/test_ruby_application.py @@ -2,6 +2,7 @@ import re import subprocess import pytest + from unit.applications.lang.ruby import ApplicationRuby prerequisites = {'modules': {'ruby': 'all'}} -- cgit From 4e08f4954917ba8485823ab56619089a75c25129 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Mon, 15 Jan 2024 17:53:46 +0000 Subject: Tests: added Ruby tests with array in header values --- test/test_ruby_application.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/test_ruby_application.py') diff --git a/test/test_ruby_application.py b/test/test_ruby_application.py index aae89999..127b75b7 100644 --- a/test/test_ruby_application.py +++ b/test/test_ruby_application.py @@ -309,6 +309,26 @@ def test_ruby_application_header_status(): assert client.get()['status'] == 200, 'header status' +def test_ruby_application_header_array(): + client.load('header_array') + + assert client.get()['headers']['x-array'] == 'name=value; ; value; av' + + +def test_ruby_application_header_array_nil(): + client.load('header_array_nil') + + assert client.get()['status'] == 503 + + +def test_ruby_application_header_array_empty(): + client.load('header_array_empty') + + headers = client.get()['headers'] + assert 'x-array' in headers + assert headers['x-array'] == '' + + @pytest.mark.skip('not yet') def test_ruby_application_header_rack(): client.load('header_rack') -- cgit