2021-06-07 07:10:18 -07:00
|
|
|
from .context import mango
|
2021-06-07 11:38:43 -07:00
|
|
|
from .fakes import fake_token
|
2021-06-07 07:10:18 -07:00
|
|
|
|
|
|
|
from decimal import Decimal
|
|
|
|
|
|
|
|
import datetime
|
|
|
|
|
|
|
|
|
|
|
|
def test_constructor():
|
|
|
|
last_update = datetime.datetime.now()
|
2021-06-07 11:38:43 -07:00
|
|
|
token = fake_token()
|
|
|
|
borrow = mango.TokenValue(token, Decimal(27))
|
|
|
|
deposit = mango.TokenValue(token, Decimal(62))
|
|
|
|
actual = mango.Index(mango.Version.V1, token, last_update, borrow, deposit)
|
2021-06-07 07:10:18 -07:00
|
|
|
assert actual is not None
|
|
|
|
assert actual.logger is not None
|
|
|
|
assert actual.last_update == last_update
|
|
|
|
assert actual.borrow == borrow
|
|
|
|
assert actual.deposit == deposit
|