Wrapped to allow retry of non-posting requests"
"""
- origin_request = super(poloniexE, self).request
+ origin_request = super().request
kwargs = {
"api": api,
"method": method,
return origin_request(path, **kwargs)
def __init__(self, *args, **kwargs):
- super(poloniexE, self).__init__(*args, **kwargs)
+ super().__init__(*args, **kwargs)
# For requests logging
self.session.origin_request = self.session.request
return all_balances
def create_exchange_order(self, symbol, type, side, amount, price=None, params={}):
- return super(poloniexE, self).create_order(symbol, type, side, amount, price=price, params=params)
+ return super().create_order(symbol, type, side, amount, price=price, params=params)
def create_margin_order(self, symbol, type, side, amount, price=None, lending_rate=None, params={}):
if type == 'market':
return type('Args', (object,), { "debug": debug, "quiet": quiet })()
def setUp(self):
- super(WebMockTestCase, self).setUp()
+ super().setUp()
self.wm = requests_mock.Mocker()
self.wm.start()
for patcher in self.patchers:
patcher.stop()
self.wm.stop()
- super(WebMockTestCase, self).tearDown()
+ super().tearDown()
@unittest.skipUnless("unit" in limits, "Unit skipped")
class poloniexETest(unittest.TestCase):
def setUp(self):
- super(poloniexETest, self).setUp()
+ super().setUp()
self.wm = requests_mock.Mocker()
self.wm.start()
def tearDown(self):
self.wm.stop()
- super(poloniexETest, self).tearDown()
+ super().tearDown()
def test__init(self):
with mock.patch("market.ccxt.poloniexE.session") as session:
@unittest.skipUnless("unit" in limits, "Unit skipped")
class PortfolioTest(WebMockTestCase):
def setUp(self):
- super(PortfolioTest, self).setUp()
+ super().setUp()
with open("test_samples/test_portfolio.json") as example:
self.json_response = example.read()
@unittest.skipUnless("unit" in limits, "Unit skipped")
class MarketTest(WebMockTestCase):
def setUp(self):
- super(MarketTest, self).setUp()
+ super().setUp()
self.ccxt = mock.Mock(spec=market.ccxt.poloniexE)
@unittest.skipUnless("unit" in limits, "Unit skipped")
class BalanceStoreTest(WebMockTestCase):
def setUp(self):
- super(BalanceStoreTest, self).setUp()
+ super().setUp()
self.fetch_balance = {
"ETC": {