Skip to content

Commit

Permalink
Create test_blockchain.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 4, 2024
1 parent c358ce5 commit 317b045
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions blockchain_integration/pi_network/daictd/tests/test_blockchain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import unittest
from blockchain import Blockchain

class TestBlockchain(unittest.TestCase):
def setUp(self):
self.blockchain = Blockchain()

def test_add_block(self):
# Test adding a new block to the blockchain
block_data = [...]
self.blockchain.add_block(block_data)
self.assertEqual(len(self.blockchain.chain), 1)

def test_verify_chain(self):
# Test verifying the integrity of the blockchain
self.assertTrue(self.blockchain.verify_chain())

if __name__ == '__main__':
unittest.main()

0 comments on commit 317b045

Please sign in to comment.