Skip to content

Commit

Permalink
adapt
Browse files Browse the repository at this point in the history
  • Loading branch information
chamini2 committed Dec 10, 2024
1 parent 01f0539 commit bca4960
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ def test_user_logs_immediate(stub: definitions.IsolateStub, monkeypatch: Any) ->
import sys, pyjokes
print(pyjokes.__version__)
print("error error!", file=sys.stderr)
print("[debug] error!", file=sys.stderr)
"""
),
),
Expand All @@ -263,11 +264,12 @@ def test_user_logs_immediate(stub: definitions.IsolateStub, monkeypatch: Any) ->
user_logs: List[Log] = []
run_request(stub, request, user_logs=user_logs)

assert len(user_logs) == 2
assert len(user_logs) == 3

by_stream = {log.level: log.message for log in user_logs}
assert by_stream[LogLevel.STDOUT] == "0.6.0"
assert by_stream[LogLevel.STDERR] == "error error!"
assert by_stream[LogLevel.ERROR] == "0.6.0"
assert by_stream[LogLevel.INFO] == "error error!"
assert by_stream[LogLevel.DEBUG] == "[debug] error!"


def test_unknown_environment(stub: definitions.IsolateStub, monkeypatch: Any) -> None:
Expand Down

0 comments on commit bca4960

Please sign in to comment.