Beispiel #1
0
    def test_get_sell_amount(self):
        session = mommy.make(Session)
        trader = Trader(session_id=session.id)

        amount = trader.get_sell_amount()

        assert amount == 59408221
Beispiel #2
0
    def test_get_sell_min_value(self):
        session = mommy.make(Session)
        trader = Trader(session_id=session.id)

        settings.EXCHANGES['BL3P']['min_sell_value'] = {
            'BTCEUR': 100000000,
            'LTCEUR': 100000000
        }

        amount = trader.get_sell_amount()

        settings.EXCHANGES['BL3P']['min_sell_value'] = {
            'BTCEUR': 50000,
            'LTCEUR': 5000000
        }

        assert amount == 0
Beispiel #3
0
    def test_get_sell_max_value(self):
        session = mommy.make(Session)
        trader = Trader(session_id=session.id)

        settings.EXCHANGES['BL3P']['max_sell_value'] = {
            'LTCEUR': 1,
            'BTCEUR': 1
        }

        amount = trader.get_sell_amount()

        settings.EXCHANGES['BL3P']['max_sell_value'] = {
            'LTCEUR': -1,
            'BTCEUR': -1
        }

        assert amount == 1