forked from bitshares/python-bitshares
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_extensions.py
More file actions
36 lines (28 loc) · 1.22 KB
/
test_extensions.py
File metadata and controls
36 lines (28 loc) · 1.22 KB
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
import unittest
from pprint import pprint
from bitsharesbase.objects import CallOrderExtension, AccountCreateExtensions
from .fixtures import fixture_data, bitshares, wif
class Testcases(unittest.TestCase):
def setUp(self):
fixture_data()
def test_callOrderExstension(self):
x = CallOrderExtension(target_collateral_ratio=200000)
self.assertIn("target_collateral_ratio", x.json)
self.assertEqual(x.json["target_collateral_ratio"], 200000)
def test_callOrderExstension2(self):
x = CallOrderExtension({"target_collateral_ratio": 200000})
self.assertIn("target_collateral_ratio", x.json)
self.assertEqual(x.json["target_collateral_ratio"], 200000)
def test_AccountCreateExtension(self):
x = AccountCreateExtensions({
"buyback_options": {
"asset_to_buy": "1.3.127",
"asset_to_buy_issuer": "1.2.31",
"markets": ["1.3.20"]},
"null_ext": {},
"owner_special_authority":
[1, {"asset": "1.3.127",
"num_top_holders": 10}]
})
self.assertIn("buyback_options", x.json)
self.assertIn("asset_to_buy", x.json["buyback_options"])