From b0c6ff7a65f53b6432335d925e239b9ba9026684 Mon Sep 17 00:00:00 2001 From: danielsanchezq Date: Tue, 11 Apr 2023 10:29:42 +0200 Subject: [PATCH] Fix assertions on test --- carnot/test_unhappy_path.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/carnot/test_unhappy_path.py b/carnot/test_unhappy_path.py index f58347b..a3f4384 100644 --- a/carnot/test_unhappy_path.py +++ b/carnot/test_unhappy_path.py @@ -184,14 +184,9 @@ class TestCarnotHappyPath(TestCase): leader.propose_block(2, [root_new_view, new_view_1, new_view_leaf_2]) # Add final assertions on nodes - - new_block_1 = node_1.latest_event - # Gives an error that AttributeError: 'NewView' object has no attribute 'qc' somehow it returns newView - # instead of a block - self.assertEqual(new_block_1.qc.view, 0) - -# Assertion should be: -# last_timeout_view_qc.view should be 1 -# high_qc.view should be 0 -# current_view should be 2 (after voting for block) -# last_voted_view should be 1 before voting and 2 after voting for the block \ No newline at end of file + new_block_1 = leader.latest_event + self.assertEqual(new_block_1.view, 2) + self.assertEqual(new_block_1.qc.view, 1) + self.assertEqual(leader.last_timeout_view_qc.view, 1) + self.assertEqual(leader.local_high_qc.view, 0) + self.assertEqual(leader.highest_voted_view, 1) \ No newline at end of file