@@ -57,7 +57,7 @@ def check_trade_availability(self, symbol: str, count_until: int) -> bool:
5757 self .__counter_flag = True
5858
5959 if self .__minutes_counter == count_until :
60- logger .info ("Trading is allowed.\n " )
60+ logger .info ("Trading is allowed." )
6161 self .__reset_counters ()
6262
6363 return self .__allowed_to_trade
@@ -68,3 +68,59 @@ def __reset_counters(self) -> None:
6868 self .__counter_flag = True
6969 self .__allow_to_count = False
7070 self .__allowed_to_trade = True
71+
72+ # Test-only methods
73+ def _test_get_minutes_counter (self ) -> int :
74+ """Get the minutes counter (for testing only)."""
75+ logger .warning ("This method is for testing purposes only and should not be used in production code." )
76+ return self .__minutes_counter
77+
78+ def _test_get_counter_flag (self ) -> bool :
79+ """Get the counter flag (for testing only)."""
80+ logger .warning ("This method is for testing purposes only and should not be used in production code." )
81+ return self .__counter_flag
82+
83+ def _test_get_allowed_to_trade (self ) -> bool :
84+ """Get the allowed to trade flag (for testing only)."""
85+ logger .warning ("This method is for testing purposes only and should not be used in production code." )
86+ return self .__allowed_to_trade
87+
88+ def _test_get_allow_to_count (self ) -> bool :
89+ """Get the allow to count flag (for testing only)."""
90+ logger .warning ("This method is for testing purposes only and should not be used in production code." )
91+ return self .__allow_to_count
92+
93+ def _test_get_recent_trade (self ) -> bool :
94+ """Get the recent trade flag (for testing only)."""
95+ logger .warning ("This method is for testing purposes only and should not be used in production code." )
96+ return self .__recent_trade
97+
98+ def _test_set_minutes_counter (self , value : int ) -> None :
99+ """Set the minutes counter (for testing only)."""
100+ logger .warning ("This method is for testing purposes only and should not be used in production code." )
101+ self .__minutes_counter = value
102+
103+ def _test_set_counter_flag (self , value : bool ) -> None :
104+ """Set the counter flag (for testing only)."""
105+ logger .warning ("This method is for testing purposes only and should not be used in production code." )
106+ self .__counter_flag = value
107+
108+ def _test_set_allowed_to_trade (self , value : bool ) -> None :
109+ """Set the allowed to trade flag (for testing only)."""
110+ logger .warning ("This method is for testing purposes only and should not be used in production code." )
111+ self .__allowed_to_trade = value
112+
113+ def _test_set_allow_to_count (self , value : bool ) -> None :
114+ """Set the allow to count flag (for testing only)."""
115+ logger .warning ("This method is for testing purposes only and should not be used in production code." )
116+ self .__allow_to_count = value
117+
118+ def _test_set_recent_trade (self , value : bool ) -> None :
119+ """Set the recent trade flag (for testing only)."""
120+ logger .warning ("This method is for testing purposes only and should not be used in production code." )
121+ self .__recent_trade = value
122+
123+ def _test_reset_counters (self ) -> None :
124+ """Reset counters (for testing only)."""
125+ logger .warning ("This method is for testing purposes only and should not be used in production code." )
126+ self .__reset_counters ()
0 commit comments