Skip to content

Commit daa4a2b

Browse files
committed
fix: add missing choch_plus columns to TestGetChochBosStats test data
The test setUp was missing choch_plus_bullish and choch_plus_bearish columns that get_choch_bos_stats() expects. Also updated assertions to cover choch_plus counts and total_choch_plus key. Pre-existing bug on main (not introduced by this PR).
1 parent ea959a2 commit daa4a2b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/indicators/test_market_structure.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ def setUp(self):
334334
self.df = pd.DataFrame({
335335
'choch_bullish': [0, 1, 0, 1, 0],
336336
'choch_bearish': [1, 0, 1, 0, 0],
337+
'choch_plus_bullish': [0, 0, 0, 1, 0],
338+
'choch_plus_bearish': [0, 1, 0, 0, 0],
337339
'bos_bullish': [0, 0, 1, 0, 1],
338340
'bos_bearish': [1, 0, 0, 1, 0]
339341
})
@@ -348,8 +350,10 @@ def test_get_choch_bos_stats_keys(self):
348350
result = get_choch_bos_stats(self.df)
349351
expected_keys = [
350352
'choch_bullish_count', 'choch_bearish_count',
353+
'choch_plus_bullish_count',
354+
'choch_plus_bearish_count',
351355
'bos_bullish_count', 'bos_bearish_count',
352-
'total_choch', 'total_bos'
356+
'total_choch', 'total_choch_plus', 'total_bos'
353357
]
354358
for key in expected_keys:
355359
self.assertIn(key, result)
@@ -359,9 +363,12 @@ def test_get_choch_bos_stats_counts(self):
359363
result = get_choch_bos_stats(self.df)
360364
self.assertEqual(result['choch_bullish_count'], 2)
361365
self.assertEqual(result['choch_bearish_count'], 2)
366+
self.assertEqual(result['choch_plus_bullish_count'], 1)
367+
self.assertEqual(result['choch_plus_bearish_count'], 1)
362368
self.assertEqual(result['bos_bullish_count'], 2)
363369
self.assertEqual(result['bos_bearish_count'], 2)
364370
self.assertEqual(result['total_choch'], 4)
371+
self.assertEqual(result['total_choch_plus'], 2)
365372
self.assertEqual(result['total_bos'], 4)
366373

367374

0 commit comments

Comments
 (0)