
    &j-                    D    d dl mZ d dlZd dlmc mZ d dlm	Z
 d Zd ZdS )    )annotationsN)tiny_autonomous_live_runtimec                h   |                      dd           t          j        g d          }|                                j        }d}||k    }|st          j        d|fd||f          dt          j                    v st          j	        |          rt          j
        |          ndt          j
        |          d	z  }d
d|iz  }t          t          j        |                    d x}}d}||v }|st          j        d|fd||f          t          j
        |          dt          j                    v st          j	        |          rt          j
        |          nddz  }d
d|iz  }t          t          j        |                    d x}}d}||v }|st          j        d|fd||f          t          j
        |          dt          j                    v st          j	        |          rt          j
        |          nddz  }d
d|iz  }t          t          j        |                    d x}}d S )N CTB_TINY_AUTONOMOUS_LIVE_ALLOWEDF)raising)z--modelivez--iterations1z--json   ==)z%(py0)s == %(py3)scode)py0py3zassert %(py5)spy5)in)z%(py1)s in %(py3)sout)py1r   mainnet_signed_action)delenvrtmain
readouterrr   
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanation)	monkeypatchcapsysr   r   @py_assert2@py_assert1@py_format4@py_format6@py_assert0s	            ]/home/agent/projects/CryptoTradingBot/Crypto_Agent/tests/test_tiny_autonomous_live_runtime.py9test_tiny_autonomous_live_mode_requires_explicit_env_gater)      s   95III7DDDEED





!C41941441-4-4444444444-44444-4444444444444444444444444444444444444444444")"c))))))))))"c)))))")))))))))))c)))))c)))))))))))))))))))))))))))))    c                   |                     t          d|            |                     t          d| dz             t          j                    }d|d<   t          j        |           t          j                    d         }d}||k    }|slt	          j        d|fd||f          t	          j        |          t	          j        |          dz  }d	d
|iz  }t          t	          j        |                    d x}x}}d S )NRUNTIME_DIR
STATE_PATHz
state.jsonz-1.0daily_realized_pnlr   )z%(py1)s == %(py4)s)r   py4zassert %(py6)spy6)	setattrr   _load_state_save_stater   r   r   r   r    )tmp_pathr!   stater'   @py_assert3r#   @py_format5@py_format7s           r(   !test_tiny_runtime_state_roundtripr9      s   M8444L(\*ABBBNE"(E
N5>01;V;1V;;;;;;;;;;1V;;;;;1;;;;V;;;;;;;;;;;;;;;;;;;;;;;;;;;;;r*   )
__future__r   builtinsr   _pytest.assertion.rewrite	assertionrewriter   	src.toolsr   r   r)   r9    r*   r(   <module>rA      sl    " " " " " "               8 8 8 8 8 8* * *< < < < <r*   