forked from bitshares/python-bitshares
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_block.py
More file actions
23 lines (19 loc) · 837 Bytes
/
test_block.py
File metadata and controls
23 lines (19 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# -*- coding: utf-8 -*-
import unittest
from pprint import pprint
from bitshares import BitShares
from bitshares.block import Block, BlockHeader
from bitshares.instance import set_shared_bitshares_instance
from bitshares.utils import parse_time
from .fixtures import fixture_data
class Testcases(unittest.TestCase):
def setUp(self):
fixture_data()
def test_block(self):
block = Block(1, use_cache=True)
self.assertEqual(block["previous"], "0000000000000000000000000000000000000000")
self.assertEqual(block.time(), parse_time("2015-10-13T14:12:24"))
def test_blockheader(self):
header = BlockHeader(1, use_cache=True)
self.assertEqual(header["previous"], "0000000000000000000000000000000000000000")
self.assertEqual(header.time(), parse_time("2015-10-13T14:12:24"))