Guest User

Untitled

a guest
Feb 9th, 2020
486
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.20 KB | None | 0 0
  1. import pytest
  2. """from brownie import accounts"""
  3.  
  4.  
  5. @pytest.fixture
  6. def foo(FooCoin,accounts):
  7.     return FooCoin.deploy(10000,"FooCoin", "FCN", 18, {'from': accounts[0]})
  8.  
  9.  
  10. def test_transfer(foo):
  11.     foo.transfer(accounts[1],2,{'from': accounts[0]})
  12.     assert foo.balanceOf(accounts[0]) == 9998
  13.  
  14.  
  15. """ WILL TROW THE FOLLOWING ERROR """
  16.  
  17.  
  18. tests/test_deployfoocoin.py F                                                                                                                   [100%]
  19.  
  20. ====================================================================== FAILURES =======================================================================
  21. ____________________________________________________________________ test_transfer ____________________________________________________________________
  22.  
  23. foo = <FooCoin Contract '0x602C71e4DAC47a042Ee7f46E0aee17F94A3bA0B6'>
  24.  
  25.     def test_transfer(foo):
  26. >       foo.transfer(accounts[1],2,{'from': accounts[0]})
  27. E       NameError: name 'accounts' is not defined
  28.  
  29. tests/test_deployfoocoin.py:11: NameError
  30. ============================================================= 1 failed, 1 passed in 2.30s =============================================================
Advertisement
Add Comment
Please, Sign In to add comment