$ make student-test
BASE_URL="http://localhost:8080" poetry run pytest
/Users/enterxx/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(
============================= test session starts ==============================
platform darwin -- Python 3.12.12, pytest-9.1.1, pluggy-1.6.0 -- /Users/enterxx/Library/Caches/pypoetry/virtualenvs/max2-jSniokBX-py3.12/bin/python
cachedir: .pytest_cache
rootdir: /Users/enterxx/Desktop/university/4course/mtusi2026lab3
configfile: pyproject.toml
testpaths: student-tests
plugins: anyio-4.15.1
collecting ... collected 113 items

student-tests/test_auth.py::test_login_returns_opaque_bearer_session PASSED [  0%]
student-tests/test_auth.py::test_wrong_password_and_unknown_user_are_indistinguishable PASSED [  1%]
student-tests/test_auth.py::test_malformed_basic_is_unauthorized[None] PASSED [  2%]
student-tests/test_auth.py::test_malformed_basic_is_unauthorized[] PASSED [  3%]
student-tests/test_auth.py::test_malformed_basic_is_unauthorized[Basic] PASSED [  4%]
student-tests/test_auth.py::test_malformed_basic_is_unauthorized[Basic !!!not-base64!!!] PASSED [  5%]
student-tests/test_auth.py::test_malformed_basic_is_unauthorized[Basic bm8tY29sb24taGVyZQ==] PASSED [  6%]
student-tests/test_auth.py::test_malformed_basic_is_unauthorized[Basic //46cGFzc3dvcmQ=] PASSED [  7%]
student-tests/test_auth.py::test_malformed_basic_is_unauthorized[Bearer some-token] PASSED [  7%]
student-tests/test_auth.py::test_utf8_password_with_colon PASSED         [  8%]
student-tests/test_auth.py::test_basic_is_rejected_on_business_endpoints PASSED [  9%]
student-tests/test_auth.py::test_logout_revokes_only_current_session PASSED [ 10%]
student-tests/test_auth.py::test_logout_without_token PASSED             [ 11%]
student-tests/test_auth.py::test_relogin_after_logout PASSED             [ 12%]
student-tests/test_auth.py::test_password_is_not_stored_in_plaintext PASSED [ 13%]
student-tests/test_balancing.py::test_one_session_is_served_by_several_replicas PASSED [ 14%]
student-tests/test_balancing.py::test_write_is_visible_through_every_replica PASSED [ 15%]
student-tests/test_balancing.py::test_logout_applies_to_all_replicas PASSED [ 15%]
student-tests/test_balancing.py::test_every_api_response_has_instance_id PASSED [ 16%]
student-tests/test_concurrency.py::test_parallel_messages_are_not_lost_or_duplicated PASSED [ 17%]
student-tests/test_dependency_failures.py::test_valkey_down_cache_is_bypassed SKIPPED [ 18%]
student-tests/test_dependency_failures.py::test_logout_during_valkey_outage_is_not_resurrected SKIPPED [ 19%]
student-tests/test_dependency_failures.py::test_postgres_down_returns_bounded_503_and_no_anonymous_access SKIPPED [ 20%]
student-tests/test_dependency_failures.py::test_session_survives_postgres_restart SKIPPED [ 21%]
student-tests/test_expiry.py::test_session_expires_after_short_ttl SKIPPED [ 22%]
student-tests/test_expiry.py::test_expires_at_matches_short_ttl SKIPPED  [ 23%]
student-tests/test_foreign_chat.py::test_outsider_cannot_access_chat PASSED [ 23%]
student-tests/test_foreign_chat.py::test_foreign_and_missing_chat_are_indistinguishable PASSED [ 24%]
student-tests/test_foreign_chat.py::test_chat_list_contains_only_own_chats PASSED [ 25%]
student-tests/test_health.py::test_health_endpoints_have_request_id PASSED [ 26%]
student-tests/test_health.py::test_unknown_route_uses_error_format PASSED [ 27%]
student-tests/test_idempotency.py::test_replay_returns_same_message PASSED [ 28%]
student-tests/test_idempotency.py::test_replay_ignores_json_formatting PASSED [ 29%]
student-tests/test_idempotency.py::test_same_key_with_other_body_is_conflict PASSED [ 30%]
student-tests/test_idempotency.py::test_missing_or_invalid_key_is_rejected[headers0] PASSED [ 30%]
student-tests/test_idempotency.py::test_missing_or_invalid_key_is_rejected[headers1] PASSED [ 31%]
student-tests/test_idempotency.py::test_missing_or_invalid_key_is_rejected[headers2] PASSED [ 32%]
student-tests/test_idempotency.py::test_missing_or_invalid_key_is_rejected[headers3] PASSED [ 33%]
student-tests/test_idempotency.py::test_missing_or_invalid_key_is_rejected[headers4] PASSED [ 34%]
student-tests/test_idempotency.py::test_missing_or_invalid_key_is_rejected[headers5] PASSED [ 35%]
student-tests/test_idempotency.py::test_key_boundaries_are_accepted[xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx] PASSED [ 36%]
student-tests/test_idempotency.py::test_key_boundaries_are_accepted[Az09._:-] PASSED [ 37%]
student-tests/test_idempotency.py::test_key_scope_is_user_and_chat PASSED [ 38%]
student-tests/test_idempotency.py::test_replay_rechecks_session_and_access PASSED [ 38%]
student-tests/test_idempotency.py::test_expired_key_can_be_reused PASSED [ 39%]
student-tests/test_idempotency.py::test_parallel_replays_through_replicas_create_one_message PASSED [ 40%]
student-tests/test_idempotency.py::test_parallel_same_key_with_different_bodies PASSED [ 41%]
student-tests/test_invalid_json.py::test_malformed_json_on_register[{"username": "abc",] PASSED [ 42%]
student-tests/test_invalid_json.py::test_malformed_json_on_register[not json at all] PASSED [ 43%]
student-tests/test_invalid_json.py::test_malformed_json_on_register[{"text": "\xff\xfe"}] PASSED [ 44%]
student-tests/test_invalid_json.py::test_malformed_json_on_register[] PASSED [ 45%]
student-tests/test_invalid_json.py::test_malformed_json_on_create_chat_and_message[{"username": "abc",] PASSED [ 46%]
student-tests/test_invalid_json.py::test_malformed_json_on_create_chat_and_message[not json at all] PASSED [ 46%]
student-tests/test_invalid_json.py::test_malformed_json_on_create_chat_and_message[{"text": "\xff\xfe"}] PASSED [ 47%]
student-tests/test_invalid_json.py::test_malformed_json_on_create_chat_and_message[] PASSED [ 48%]
student-tests/test_invalid_json.py::test_invalid_user_payload[body0] PASSED [ 49%]
student-tests/test_invalid_json.py::test_invalid_user_payload[alice] PASSED [ 50%]
student-tests/test_invalid_json.py::test_invalid_user_payload[body2] PASSED [ 51%]
student-tests/test_invalid_json.py::test_invalid_user_payload[body3] PASSED [ 52%]
student-tests/test_invalid_json.py::test_invalid_user_payload[body4] PASSED [ 53%]
student-tests/test_invalid_json.py::test_invalid_user_payload[body5] PASSED [ 53%]
student-tests/test_invalid_json.py::test_invalid_user_payload[body6] PASSED [ 54%]
student-tests/test_invalid_json.py::test_invalid_user_payload[body7] PASSED [ 55%]
student-tests/test_invalid_json.py::test_invalid_user_payload[body8] PASSED [ 56%]
student-tests/test_invalid_json.py::test_invalid_user_payload[body9] PASSED [ 57%]
student-tests/test_invalid_json.py::test_invalid_user_payload[body10] PASSED [ 58%]
student-tests/test_invalid_json.py::test_invalid_message_payload[body0] PASSED [ 59%]
student-tests/test_invalid_json.py::test_invalid_message_payload[body1] PASSED [ 60%]
student-tests/test_invalid_json.py::test_invalid_message_payload[body2] PASSED [ 61%]
student-tests/test_invalid_json.py::test_invalid_chat_payload PASSED     [ 61%]
student-tests/test_messages.py::test_empty_or_blank_message_is_rejected[] PASSED [ 62%]
student-tests/test_messages.py::test_empty_or_blank_message_is_rejected[ ] PASSED [ 63%]
student-tests/test_messages.py::test_empty_or_blank_message_is_rejected[   \n\t  ] PASSED [ 64%]
student-tests/test_messages.py::test_empty_or_blank_message_is_rejected[\u3000] PASSED [ 65%]
student-tests/test_messages.py::test_message_length_is_counted_in_code_points PASSED [ 66%]
student-tests/test_messages.py::test_unicode_is_preserved PASSED         [ 67%]
student-tests/test_messages.py::test_nul_character_is_rejected PASSED    [ 68%]
student-tests/test_messages.py::test_sender_is_taken_from_session PASSED [ 69%]
student-tests/test_pagination.py::test_walk_message_pages[7-3-3] PASSED  [ 69%]
student-tests/test_pagination.py::test_walk_message_pages[6-3-2] PASSED  [ 70%]
student-tests/test_pagination.py::test_walk_message_pages[5-1-5] PASSED  [ 71%]
student-tests/test_pagination.py::test_walk_message_pages[3-100-1] PASSED [ 72%]
student-tests/test_pagination.py::test_limit_can_change_between_pages PASSED [ 73%]
student-tests/test_pagination.py::test_new_message_appears_after_cursor PASSED [ 74%]
student-tests/test_pagination.py::test_cursor_is_bound_to_chat PASSED    [ 75%]
student-tests/test_pagination.py::test_invalid_limit_or_cursor[params0] PASSED [ 76%]
student-tests/test_pagination.py::test_invalid_limit_or_cursor[params1] PASSED [ 76%]
student-tests/test_pagination.py::test_invalid_limit_or_cursor[params2] PASSED [ 77%]
student-tests/test_pagination.py::test_invalid_limit_or_cursor[params3] PASSED [ 78%]
student-tests/test_pagination.py::test_invalid_limit_or_cursor[params4] PASSED [ 79%]
student-tests/test_pagination.py::test_invalid_limit_or_cursor[params5] PASSED [ 80%]
student-tests/test_pagination.py::test_walk_chat_list_pages PASSED       [ 81%]
student-tests/test_pagination.py::test_chat_cursor_is_bound_to_user PASSED [ 82%]
student-tests/test_transactions.py::test_same_username_race_creates_exactly_one_user PASSED [ 83%]
student-tests/test_transactions.py::test_failed_chat_creation_is_rolled_back PASSED [ 84%]
student-tests/test_transactions.py::test_successful_chat_creation_commits_all_members PASSED [ 84%]
student-tests/test_users.py::test_duplicate_username_is_conflict PASSED  [ 85%]
student-tests/test_users.py::test_registration_never_returns_password PASSED [ 86%]
student-tests/test_users.py::test_invalid_password_is_rejected[None] PASSED [ 87%]
student-tests/test_users.py::test_invalid_password_is_rejected[] PASSED  [ 88%]
student-tests/test_users.py::test_invalid_password_is_rejected[\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439] PASSED [ 89%]
student-tests/test_users.py::test_invalid_password_is_rejected[xxxxxxxxxxx] PASSED [ 90%]
student-tests/test_users.py::test_invalid_password_is_rejected[xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx] PASSED [ 91%]
student-tests/test_users.py::test_invalid_password_is_rejected[123456789012] PASSED [ 92%]
student-tests/test_users.py::test_password_length_is_counted_in_code_points PASSED [ 92%]
student-tests/test_users.py::test_missing_or_unknown_token_is_unauthorized[headers0] PASSED [ 93%]
student-tests/test_users.py::test_missing_or_unknown_token_is_unauthorized[headers1] PASSED [ 94%]
student-tests/test_users.py::test_missing_or_unknown_token_is_unauthorized[headers2] PASSED [ 95%]
student-tests/test_users.py::test_missing_or_unknown_token_is_unauthorized[headers3] PASSED [ 96%]
student-tests/test_users.py::test_missing_or_unknown_token_is_unauthorized[headers4] PASSED [ 97%]
student-tests/test_users.py::test_missing_or_unknown_token_is_unauthorized[headers5] PASSED [ 98%]
student-tests/test_users.py::test_x_user_id_gives_no_access PASSED       [ 99%]
student-tests/test_users.py::test_current_user PASSED                    [100%]

======================= 107 passed, 6 skipped in 14.98s ========================
