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

Function test_format_bool

tests/test_logger.py:110–128  ·  view source on GitHub ↗

Test the _format_bool method.

()

Source from the content-addressed store, hash-verified

108
109
110def test_format_bool():
111 """Test the _format_bool method."""
112 logger = ScreenLogger()
113
114 # Test True formatting
115 true_str = logger._format_bool(True)
116 assert len(true_str) == logger._default_cell_size
117 assert "True" in true_str
118
119 # Test False formatting
120 false_str = logger._format_bool(False)
121 assert len(false_str) == logger._default_cell_size
122 assert "False" in false_str
123
124 # Test with small cell size
125 small_cell_logger = ScreenLogger()
126 small_cell_logger._default_cell_size = 3
127 assert small_cell_logger._format_bool(True) == "T "
128 assert small_cell_logger._format_bool(False) == "F "
129
130
131def test_format_str():

Callers

nothing calls this directly

Calls 2

_format_boolMethod · 0.95
ScreenLoggerClass · 0.90

Tested by

no test coverage detected