-
Notifications
You must be signed in to change notification settings - Fork 0
/
conftest.py
45 lines (32 loc) · 1.06 KB
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/python3
import pytest
from brownie import Contract
@pytest.fixture(scope="function", autouse=True)
def isolate(fn_isolation):
# perform a chain rewind after completing each test, to ensure proper isolation
# https://eth-brownie.readthedocs.io/en/v1.10.3/tests-pytest-intro.html#isolation-fixtures
pass
# Test with the Pudgy Penguins Contract
@pytest.fixture(scope="module")
def pengu_coin(Bridge, accounts):
return Bridge.deploy(
"0xBd3531dA5CF5857e7CfAA92426877b022e612cf8",
"Penguin",
"PENGU",
18,
{"from": accounts[0]},
)
@pytest.fixture(scope="module")
def nft_id():
return 0
@pytest.fixture(scope="module")
def pengu_nft(pengu_coin):
return Contract(pengu_coin.linked721())
@pytest.fixture(scope="module")
def holder(pengu_nft, nft_id):
return pengu_nft.ownerOf(nft_id)
@pytest.fixture(scope="module")
def wrapped_pengu(pengu_coin, pengu_nft, holder, nft_id):
pengu_nft.approve(pengu_coin, nft_id, {"from": holder})
pengu_coin.wrap(nft_id, {"from": holder})
return pengu_coin