Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _virtualenv) Savils-MacBook:auction-keeper savil$ ./test.sh
- unit-testing: Pulling from makerdao/testchain-pymaker
- Digest: sha256:ceb56f43945c0554079a05f15e3ac76020055e9e8f87f4da4d6505b089da8207
- Status: Image is up to date for makerdao/testchain-pymaker:unit-testing
- docker.io/makerdao/testchain-pymaker:unit-testing
- ~/code/makerdao/auction-keeper/lib/pymaker ~/code/makerdao/auction-keeper
- Creating network "pymaker_default" with the default driver
- Creating parity-pymaker-test ... done
- ~/code/makerdao/auction-keeper
- ============================================================================= test session starts =============================================================================
- platform darwin -- Python 3.7.3, pytest-3.5.0, py-1.8.0, pluggy-0.6.0
- rootdir: /Users/savil/code/makerdao/auction-keeper, inifile:
- plugins: timeout-1.2.1, mock-1.6.3, cov-2.5.1, asyncio-0.8.0
- collected 94 items
- tests/test_accounting.py ......... [ 9%]
- tests/test_bite.py . [ 10%]
- tests/test_config.py ...... [ 17%]
- tests/test_flap.py ..............s..... [ 38%]
- tests/test_flip.py ...FF...........s........ [ 64%]
- tests/test_flop.py .........F.......... [ 86%]
- tests/test_process.py ............. [100%]
- ================================================================================== FAILURES ===================================================================================
- ________________________________________ TestAuctionKeeperFlipper.test_should_provide_model_with_updated_info_after_somebody_else_bids ________________________________________
- self = <tests.test_flip.TestAuctionKeeperFlipper object at 0x10ff1d4a8>
- mcd = DssDeployment({"MCD_PAUSE": "0x967aE1FB90aA36C7d3B16B5328504F542495D952", "MCD_VAT": "0x31865076D1E28ad4eA06D5Db7aAa4A..._GNT_A": "0x0363Ef677c78bd8C8302DB33be2F6629E33E72Fe", "MCD_FLIP_GNT_A": "0xE535a9b2a962dFf9F612AE8A1b8d54932e60a6A1"})
- c = <pymaker.dss.Collateral object at 0x10f465e10>, other_address = Address('0x5BEB2D3aA2333A524703Af18310AcFf462c04723')
- keeper = <auction_keeper.main.AuctionKeeper object at 0x10fed25f8>
- def test_should_provide_model_with_updated_info_after_somebody_else_bids(self, mcd, c, other_address, keeper):
- # given
- flipper = c.flipper
- kick = flipper.kicks()
- (model, model_factory) = models(keeper, kick)
- # when
- keeper.check_all_auctions()
- wait_for_other_threads()
- # then
- > assert model.send_status.call_count == 1
- E AssertionError: assert 0 == 1
- E + where 0 = <MagicMock name='mock.send_status' id='4561031632'>.call_count
- E + where <MagicMock name='mock.send_status' id='4561031632'> = <MagicMock id='4561104064'>.send_status
- tests/test_flip.py:253: AssertionError
- _____________________________________________ TestAuctionKeeperFlipper.test_should_terminate_model_if_auction_expired_due_to_tau ______________________________________________
- self = <tests.test_flip.TestAuctionKeeperFlipper object at 0x10ffe5668>, c = <pymaker.dss.Collateral object at 0x10f465e10>
- keeper = <auction_keeper.main.AuctionKeeper object at 0x10ffedf28>
- def test_should_terminate_model_if_auction_expired_due_to_tau(self, c, keeper):
- # given
- flipper = c.flipper
- kick = flipper.kicks()
- (model, model_factory) = models(keeper, kick)
- # when
- keeper.check_all_auctions()
- wait_for_other_threads()
- # then
- > model_factory.create_model.assert_called_once()
- tests/test_flip.py:291:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- _mock_self = <MagicMock id='4539663416'>
- def assert_called_once(_mock_self):
- """assert that the mock was called only once.
- """
- self = _mock_self
- if not self.call_count == 1:
- msg = ("Expected '%s' to have been called once. Called %s times." %
- (self._mock_name or 'mock', self.call_count))
- > raise AssertionError(msg)
- E AssertionError: Expected 'mock' to have been called once. Called 0 times.
- _virtualenv/lib/python3.7/site-packages/mock/mock.py:915: AssertionError
- ____________________________________________________________ TestAuctionKeeperFlopper.test_should_make_initial_bid ____________________________________________________________
- self = <tests.test_flop.TestAuctionKeeperFlopper object at 0x11200eb38>
- def test_should_make_initial_bid(self):
- # given
- kick = self.flopper.kicks()
- (model, model_factory) = models(self.keeper, kick)
- mkr_before = self.mcd.mkr.balance_of(self.keeper_address)
- # when
- simulate_model_output(model=model, price=Wad.from_number(575.0))
- # and
- self.keeper.check_all_auctions()
- self.keeper.check_for_bids()
- wait_for_other_threads()
- # then
- auction = self.flopper.bids(kick)
- > assert round(auction.bid / Rad(auction.lot), 2) == round(Rad.from_number(575.0), 2)
- E AssertionError: assert Rad(0) == Rad(575000000000000000000000000000000000000000000000)
- E + where Rad(0) = round((Rad(100000000000000000000000000000000000000000) / Rad(115792089237316195423570985000000000000000000000000000000000000000000000000000000000000000000000000000000)), 2)
- E + where Rad(100000000000000000000000000000000000000000) = Flopper.Bid({'bid': Rad(100000000000000000000000000000000000000000),\n 'end': 1569952588,\n 'guy': Address('0x8A1567046e...4B50561C1d3'),\n 'lot': Wad(115792089237316195423570985008687907853269984665640564039457584007913129639935),\n 'tic': 0}).bid
- E + and Rad(115792089237316195423570985000000000000000000000000000000000000000000000000000000000000000000000000000000) = Rad(Wad(115792089237316195423570985008687907853269984665640564039457584007913129639935))
- E + where Wad(115792089237316195423570985008687907853269984665640564039457584007913129639935) = Flopper.Bid({'bid': Rad(100000000000000000000000000000000000000000),\n 'end': 1569952588,\n 'guy': Address('0x8A1567046e...4B50561C1d3'),\n 'lot': Wad(115792089237316195423570985008687907853269984665640564039457584007913129639935),\n 'tic': 0}).lot
- E + and Rad(575000000000000000000000000000000000000000000000) = round(Rad(575000000000000000000000000000000000000000000000), 2)
- E + where Rad(575000000000000000000000000000000000000000000000) = <bound method Rad.from_number of <class 'pymaker.numeric.Rad'>>(575.0)
- E + where <bound method Rad.from_number of <class 'pymaker.numeric.Rad'>> = Rad.from_number
- tests/test_flop.py:349: AssertionError
- ---------------------------------------------------------------------------- Captured stdout setup ----------------------------------------------------------------------------
- collateral_required for 200.000000000000000000 dai is 1.200000000000000001
- collateral_required for 200.000000000000000000 dai is 1.200000000000000001
- ------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------
- __init__.py 546 WARNING Transaction Flopper('0x3f2603979a4A185acE9B9c941193704FfBD24F4A').dent(8, 173913043478, 100000000000000000000000000000000000000000) will fail, refusing to send ({'code': -32016, 'message': 'The execution failed due to an exception.'})
- ---------- coverage: platform darwin, python 3.7.3-final-0 -----------
- Name Stmts Miss Cover
- ------------------------------------------------
- auction_keeper/__init__.py 0 0 100%
- auction_keeper/gas.py 11 0 100%
- auction_keeper/logic.py 52 0 100%
- auction_keeper/main.py 276 38 86%
- auction_keeper/model.py 120 15 88%
- auction_keeper/process.py 86 1 99%
- auction_keeper/strategy.py 91 3 97%
- ------------------------------------------------
- TOTAL 636 57 91%
- ============================================================== 3 failed, 89 passed, 2 skipped in 1416.32 seconds ==============================================================
- Stopping container
- ~/code/makerdao/auction-keeper/lib/pymaker ~/code/makerdao/auction-keeper
- Stopping parity-pymaker-test ... done
- Removing parity-pymaker-test ... done
- Removing network pymaker_default
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement