Skip to content

Commit 0142590

Browse files
committed
Fix flake8 warnings
1 parent 0359927 commit 0142590

38 files changed

+4069
-267
lines changed

tests/app/algorithm/test_check_order_status.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from decimal import Decimal
22

3-
from investing_algorithm_framework import PortfolioConfiguration, OrderStatus, \
4-
MarketCredential
3+
from investing_algorithm_framework import PortfolioConfiguration, \
4+
OrderStatus, MarketCredential
55
from tests.resources import TestBase
66

77

tests/app/algorithm/test_close_trade.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def setUp(self) -> None:
4242
)
4343
))
4444

45-
4645
def test_close_trade(self):
4746
trading_symbol_position = self.app.algorithm.get_position("EUR")
4847
self.assertEqual(1000, trading_symbol_position.get_amount())

tests/app/algorithm/test_create_limit_buy_order.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from investing_algorithm_framework import PortfolioConfiguration, OrderStatus, \
2-
MarketCredential
1+
from investing_algorithm_framework import PortfolioConfiguration, \
2+
OrderStatus, MarketCredential
33
from tests.resources import TestBase
44

55

@@ -38,7 +38,10 @@ def test_create_limit_buy_order(self):
3838
)
3939
order_repository = self.app.container.order_repository()
4040
self.assertEqual(
41-
1, order_repository.count({"order_type": "LIMIT", "order_side": "BUY"})
41+
1,
42+
order_repository.count(
43+
{"order_type": "LIMIT", "order_side": "BUY"}
44+
)
4245
)
4346
order = order_repository.find({"target_symbol": "BTC"})
4447
self.assertEqual(OrderStatus.OPEN.value, order.status)
@@ -53,7 +56,8 @@ def test_create_limit_buy_order_with_percentage_of_portfolio(self):
5356
)
5457
order_repository = self.app.container.order_repository()
5558
self.assertEqual(
56-
1, order_repository.count({"order_type": "LIMIT", "order_side": "BUY"})
59+
1, order_repository
60+
.count({"order_type": "LIMIT", "order_side": "BUY"})
5761
)
5862
order = order_repository.find({"target_symbol": "BTC"})
5963
self.assertEqual(OrderStatus.OPEN.value, order.status)

tests/app/algorithm/test_create_limit_sell_order.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from investing_algorithm_framework import PortfolioConfiguration, OrderStatus, \
2-
MarketCredential
1+
from investing_algorithm_framework import PortfolioConfiguration, \
2+
OrderStatus, MarketCredential
33
from tests.resources import TestBase
44

55

@@ -32,7 +32,8 @@ def test_create_limit_sell_order(self):
3232
)
3333
order_repository = self.app.container.order_repository()
3434
self.assertEqual(
35-
1, order_repository.count({"order_type": "LIMIT", "order_side": "BUY"})
35+
1, order_repository
36+
.count({"order_type": "LIMIT", "order_side": "BUY"})
3637
)
3738
order = order_repository.find({"target_symbol": "BTC"})
3839
self.assertEqual(OrderStatus.OPEN.value, order.status)
@@ -43,7 +44,7 @@ def test_create_limit_sell_order(self):
4344
self.assertEqual(800, portfolio.get_unallocated())
4445
order_service = self.app.container.order_service()
4546
order_service.check_pending_orders()
46-
position = self.app.algorithm.get_position("BTC")
47+
self.app.algorithm.get_position("BTC")
4748
order = self.app.algorithm.create_limit_order(
4849
target_symbol="BTC",
4950
price=10,
@@ -63,7 +64,8 @@ def test_create_limit_sell_order_with_percentage_position(self):
6364
)
6465
order_repository = self.app.container.order_repository()
6566
self.assertEqual(
66-
1, order_repository.count({"order_type": "LIMIT", "order_side": "BUY"})
67+
1, order_repository
68+
.count({"order_type": "LIMIT", "order_side": "BUY"})
6769
)
6870
order = order_repository.find({"target_symbol": "BTC"})
6971
self.assertEqual(OrderStatus.OPEN.value, order.status)

tests/app/algorithm/test_create_market_sell_order.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from investing_algorithm_framework import PortfolioConfiguration, OrderType, OrderSide, \
2-
OrderStatus, MarketCredential
1+
from investing_algorithm_framework import PortfolioConfiguration, \
2+
OrderType, OrderSide, OrderStatus, MarketCredential
33
from tests.resources import TestBase
44

55

tests/app/algorithm/test_get_allocated.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,3 @@ def test_get_allocated(self):
6161
self.assertNotEqual(0, self.app.algorithm.get_allocated())
6262
self.assertNotEqual(0, self.app.algorithm.get_allocated("BITVAVO"))
6363
self.assertNotEqual(0, self.app.algorithm.get_allocated("bitvavo"))
64-

tests/app/algorithm/test_get_closed_trades.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class Test(TestBase):
2323
secret_key="secret_key"
2424
)
2525
]
26-
27-
def setUp(self) -> None:
26+
27+
def setUp(self) -> None:
2828
super(Test, self).setUp()
2929
self.app.add_market_data_source(CSVTickerMarketDataSource(
3030
identifier="BTC/EUR-ticker",

tests/app/algorithm/test_get_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# import os
22
# from datetime import datetime, timedelta
3-
# from investing_algorithm_framework import create_app, TradingStrategy, TimeUnit, \
4-
# RESOURCE_DIRECTORY, PortfolioConfiguration, TradingDataType, \
5-
# TradingTimeFrame
3+
# from investing_algorithm_framework import create_app,
4+
# TradingStrategy, TimeUnit, RESOURCE_DIRECTORY, PortfolioConfiguration,
5+
# TradingDataType, TradingTimeFrame
66
# from tests.resources import TestBase, MarketServiceStub
77
#
88
#

tests/app/algorithm/test_get_open_trades.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ def test_get_open_trades_with_close_trades(self):
9595
self.assertIsNone(trade.closed_at)
9696
self.assertEqual(
9797
0,
98-
len(self.app.algorithm.get_orders(order_side="SELL", status="OPEN"))
98+
len(self.app.algorithm
99+
.get_orders(order_side="SELL", status="OPEN"))
99100
)
100101
self.app.algorithm.create_limit_order(
101102
target_symbol="BTC",

tests/app/algorithm/test_get_order.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from decimal import Decimal
22

3-
from investing_algorithm_framework import PortfolioConfiguration, OrderStatus, \
4-
MarketCredential
3+
from investing_algorithm_framework import PortfolioConfiguration, \
4+
OrderStatus, MarketCredential
55
from tests.resources import TestBase
66

77

0 commit comments

Comments
 (0)