Beispiel #1
0
 def test_get_value(self):
     with set_qrl_dir('no_data'):
         state = State()
         p = PaginatedData(b'p_tx_hash', True, state._db)
         storage_key = p.generate_key(b'a', 0)
         p.key_value[storage_key] = [10]
         self.assertEqual(p.get_value(b'a', 0), [10])
Beispiel #2
0
 def test_put(self, mock_dev_config):
     with set_qrl_dir('no_data'):
         state = State()
         p = PaginatedData(b'p_tx_hash', True, state._db)
         key = b'test_key'
         value = [b'hello world']
         storage_key = p.generate_key(key, 11)
         p.put(storage_key, value, None)
         found_value = p.get_paginated_data(key, 11)
         self.assertEqual(value, found_value)