MCPcopy Index your code
hub / github.com/bayesian-optimization/BayesianOptimization / test_format_str

Function test_format_str

tests/test_logger.py:131–144  ·  view source on GitHub ↗

Test the _format_str method.

()

Source from the content-addressed store, hash-verified

129
130
131def test_format_str():
132 """Test the _format_str method."""
133 logger = ScreenLogger()
134
135 # Test normal string
136 normal_str = logger._format_str("test")
137 assert len(normal_str) == logger._default_cell_size
138 assert "test" in normal_str
139
140 # Test long string truncation
141 long_str = "this_is_a_very_long_string_that_should_be_truncated"
142 formatted = logger._format_str(long_str)
143 assert len(formatted) == logger._default_cell_size
144 assert "..." in formatted
145
146
147def test_step():

Callers

nothing calls this directly

Calls 2

_format_strMethod · 0.95
ScreenLoggerClass · 0.90

Tested by

no test coverage detected