Skip to content

Commit

Permalink
Refactor test_unit.py
Browse files Browse the repository at this point in the history
- Remove unnecessary lines
- Add comments for clarity
  • Loading branch information
mraniki committed Oct 7, 2023
1 parent e222bd9 commit aa11bd5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,15 @@ async def test_get_trade_confirmation(CXTrader):

for client in CXTrader.clients:
# Test the 'SELL' action
result_sell = await client.get_trade_confirmation(trade_sell, "InstrumentName", "SELL")
assert result_sell == "YourExpectedResultForSell"
result_sell = await client.get_trade_confirmation(
trade_sell,
"InstrumentName",
"SELL")
assert result_sell == "YourExpectedResultForSell"

Check notice

Code scanning / Bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

# Test the 'BUY' action
result_buy = await client.get_trade_confirmation(trade_buy, "InstrumentName", "BUY")
assert result_buy == "YourExpectedResultForBuy"
#result_buy = await client.get_trade_confirmation(
#trade_buy,
#"InstrumentName",
#"BUY")
# assert result_buy == "YourExpectedResultForBuy"

0 comments on commit aa11bd5

Please sign in to comment.