mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-08-28 05:25:04 +00:00
* refactor(search): replace time module with datetime for timestamp generation - Removed unused time import - Added static method _now_ts using datetime.timestamp - Updated clock parameter to use _now_ts method instead of time.time - Maintained same timestamp precision and functionality * test(http): add tests for HTTP client display formatting - Add test for default metadata hiding behavior in CLI output - Add test for metadata display when show_metadata is enabled - Verify _format_for_display method correctly formats response text - Test both success case and metadata inclusion scenarios * chore(build): remove longmemeval from gitignore - Removed longmemeval directory from gitignore list - Kept evaluation and datasets directories in ignore list - Updated gitignore configuration for proper version control
21 lines
795 B
Python
21 lines
795 B
Python
"""Tests for HTTP client display formatting."""
|
|
|
|
# pylint: disable=protected-access
|
|
|
|
from reme.components.client.http_client import HttpClient
|
|
|
|
|
|
def test_format_for_display_hides_metadata_by_default():
|
|
"""Response metadata is available structurally but not shown in normal CLI output."""
|
|
client = HttpClient()
|
|
text = '{"answer":"0.4.0.7","success":true,"metadata":{"version":"0.4.0.7"}}'
|
|
|
|
assert client._format_for_display(text) == "0.4.0.7\n✅"
|
|
|
|
|
|
def test_format_for_display_shows_metadata_when_requested():
|
|
"""show_metadata=true opts into metadata display."""
|
|
client = HttpClient(show_metadata=True)
|
|
text = '{"answer":"0.4.0.7","success":true,"metadata":{"version":"0.4.0.7"}}'
|
|
|
|
assert client._format_for_display(text) == '0.4.0.7\n✅ {"version": "0.4.0.7"}'
|