Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.16 KB | None | 0 0
  1. _virtualenv) Savils-MacBook:auction-keeper savil$ ./test.sh
  2. unit-testing: Pulling from makerdao/testchain-pymaker
  3. Digest: sha256:ceb56f43945c0554079a05f15e3ac76020055e9e8f87f4da4d6505b089da8207
  4. Status: Image is up to date for makerdao/testchain-pymaker:unit-testing
  5. docker.io/makerdao/testchain-pymaker:unit-testing
  6. ~/code/makerdao/auction-keeper/lib/pymaker ~/code/makerdao/auction-keeper
  7. Creating network "pymaker_default" with the default driver
  8. Creating parity-pymaker-test ... done
  9. ~/code/makerdao/auction-keeper
  10. ============================================================================= test session starts =============================================================================
  11. platform darwin -- Python 3.7.3, pytest-3.5.0, py-1.8.0, pluggy-0.6.0
  12. rootdir: /Users/savil/code/makerdao/auction-keeper, inifile:
  13. plugins: timeout-1.2.1, mock-1.6.3, cov-2.5.1, asyncio-0.8.0
  14. collected 94 items
  15.  
  16. tests/test_accounting.py ......... [ 9%]
  17. tests/test_bite.py . [ 10%]
  18. tests/test_config.py ...... [ 17%]
  19. tests/test_flap.py ..............s..... [ 38%]
  20. tests/test_flip.py ...FF...........s........ [ 64%]
  21. tests/test_flop.py .........F.......... [ 86%]
  22. tests/test_process.py ............. [100%]
  23.  
  24. ================================================================================== FAILURES ===================================================================================
  25. ________________________________________ TestAuctionKeeperFlipper.test_should_provide_model_with_updated_info_after_somebody_else_bids ________________________________________
  26.  
  27. self = <tests.test_flip.TestAuctionKeeperFlipper object at 0x10ff1d4a8>
  28. mcd = DssDeployment({"MCD_PAUSE": "0x967aE1FB90aA36C7d3B16B5328504F542495D952", "MCD_VAT": "0x31865076D1E28ad4eA06D5Db7aAa4A..._GNT_A": "0x0363Ef677c78bd8C8302DB33be2F6629E33E72Fe", "MCD_FLIP_GNT_A": "0xE535a9b2a962dFf9F612AE8A1b8d54932e60a6A1"})
  29. c = <pymaker.dss.Collateral object at 0x10f465e10>, other_address = Address('0x5BEB2D3aA2333A524703Af18310AcFf462c04723')
  30. keeper = <auction_keeper.main.AuctionKeeper object at 0x10fed25f8>
  31.  
  32. def test_should_provide_model_with_updated_info_after_somebody_else_bids(self, mcd, c, other_address, keeper):
  33. # given
  34. flipper = c.flipper
  35. kick = flipper.kicks()
  36. (model, model_factory) = models(keeper, kick)
  37.  
  38. # when
  39. keeper.check_all_auctions()
  40. wait_for_other_threads()
  41. # then
  42. > assert model.send_status.call_count == 1
  43. E AssertionError: assert 0 == 1
  44. E + where 0 = <MagicMock name='mock.send_status' id='4561031632'>.call_count
  45. E + where <MagicMock name='mock.send_status' id='4561031632'> = <MagicMock id='4561104064'>.send_status
  46.  
  47. tests/test_flip.py:253: AssertionError
  48. _____________________________________________ TestAuctionKeeperFlipper.test_should_terminate_model_if_auction_expired_due_to_tau ______________________________________________
  49.  
  50. self = <tests.test_flip.TestAuctionKeeperFlipper object at 0x10ffe5668>, c = <pymaker.dss.Collateral object at 0x10f465e10>
  51. keeper = <auction_keeper.main.AuctionKeeper object at 0x10ffedf28>
  52.  
  53. def test_should_terminate_model_if_auction_expired_due_to_tau(self, c, keeper):
  54. # given
  55. flipper = c.flipper
  56. kick = flipper.kicks()
  57. (model, model_factory) = models(keeper, kick)
  58.  
  59. # when
  60. keeper.check_all_auctions()
  61. wait_for_other_threads()
  62. # then
  63. > model_factory.create_model.assert_called_once()
  64.  
  65. tests/test_flip.py:291:
  66. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  67.  
  68. _mock_self = <MagicMock id='4539663416'>
  69.  
  70. def assert_called_once(_mock_self):
  71. """assert that the mock was called only once.
  72. """
  73. self = _mock_self
  74. if not self.call_count == 1:
  75. msg = ("Expected '%s' to have been called once. Called %s times." %
  76. (self._mock_name or 'mock', self.call_count))
  77. > raise AssertionError(msg)
  78. E AssertionError: Expected 'mock' to have been called once. Called 0 times.
  79.  
  80. _virtualenv/lib/python3.7/site-packages/mock/mock.py:915: AssertionError
  81. ____________________________________________________________ TestAuctionKeeperFlopper.test_should_make_initial_bid ____________________________________________________________
  82.  
  83. self = <tests.test_flop.TestAuctionKeeperFlopper object at 0x11200eb38>
  84.  
  85. def test_should_make_initial_bid(self):
  86. # given
  87. kick = self.flopper.kicks()
  88. (model, model_factory) = models(self.keeper, kick)
  89. mkr_before = self.mcd.mkr.balance_of(self.keeper_address)
  90.  
  91. # when
  92. simulate_model_output(model=model, price=Wad.from_number(575.0))
  93. # and
  94. self.keeper.check_all_auctions()
  95. self.keeper.check_for_bids()
  96. wait_for_other_threads()
  97. # then
  98. auction = self.flopper.bids(kick)
  99. > assert round(auction.bid / Rad(auction.lot), 2) == round(Rad.from_number(575.0), 2)
  100. E AssertionError: assert Rad(0) == Rad(575000000000000000000000000000000000000000000000)
  101. E + where Rad(0) = round((Rad(100000000000000000000000000000000000000000) / Rad(115792089237316195423570985000000000000000000000000000000000000000000000000000000000000000000000000000000)), 2)
  102. 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
  103. E + and Rad(115792089237316195423570985000000000000000000000000000000000000000000000000000000000000000000000000000000) = Rad(Wad(115792089237316195423570985008687907853269984665640564039457584007913129639935))
  104. 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
  105. E + and Rad(575000000000000000000000000000000000000000000000) = round(Rad(575000000000000000000000000000000000000000000000), 2)
  106. E + where Rad(575000000000000000000000000000000000000000000000) = <bound method Rad.from_number of <class 'pymaker.numeric.Rad'>>(575.0)
  107. E + where <bound method Rad.from_number of <class 'pymaker.numeric.Rad'>> = Rad.from_number
  108.  
  109. tests/test_flop.py:349: AssertionError
  110. ---------------------------------------------------------------------------- Captured stdout setup ----------------------------------------------------------------------------
  111. collateral_required for 200.000000000000000000 dai is 1.200000000000000001
  112. collateral_required for 200.000000000000000000 dai is 1.200000000000000001
  113. ------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------
  114. __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.'})
  115.  
  116. ---------- coverage: platform darwin, python 3.7.3-final-0 -----------
  117. Name Stmts Miss Cover
  118. ------------------------------------------------
  119. auction_keeper/__init__.py 0 0 100%
  120. auction_keeper/gas.py 11 0 100%
  121. auction_keeper/logic.py 52 0 100%
  122. auction_keeper/main.py 276 38 86%
  123. auction_keeper/model.py 120 15 88%
  124. auction_keeper/process.py 86 1 99%
  125. auction_keeper/strategy.py 91 3 97%
  126. ------------------------------------------------
  127. TOTAL 636 57 91%
  128.  
  129. ============================================================== 3 failed, 89 passed, 2 skipped in 1416.32 seconds ==============================================================
  130. Stopping container
  131. ~/code/makerdao/auction-keeper/lib/pymaker ~/code/makerdao/auction-keeper
  132. Stopping parity-pymaker-test ... done
  133. Removing parity-pymaker-test ... done
  134. Removing network pymaker_default
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement