Some bug fixes needed for some Serpent files.
[robmyers:artworld-ethereum.git] / tests / test_numbered_works.py
1 from sim import Key, Simulator, load_serpent
2 from pyethereum.utils import coerce_to_bytes
3
4 class TestNumberedWorks(object):
5
6     ARTIST = Key('artist')
7     AUDIENCE = Key('audience')
8     INDEX1001 = coerce_to_bytes(1001)
9     ARTWORK_LENGTH = 26
10     ARTWORK_INSERT = 6
11
12     @classmethod
13     def setup_class(cls):
14         cls.code = load_serpent('serpent/numbered_works.se')
15         cls.sim = Simulator({cls.ARTIST.address: 10**18})
16
17     def setup_method(self, method):
18         self.sim.reset()
19         self.contract = self.sim.load_contract(self.ARTIST, self.code)
20
21     def test_initial_state(self):
22         # Get storage data only returns int...
23         assert self.sim.get_storage_data(self.contract, self.INDEX1001) == 0