Exemplo n.º 1
0
    def test_get_last_block_number_returns_correctly(self, mock_sanity_check,
                                                     mock_storage_get):
        response = level_5_actions.get_last_block_number()

        mock_sanity_check.assert_not_called()
        mock_storage_get.assert_called_once_with("BROADCAST/LAST_BLOCK")
        self.assertEqual(response, "500")
Exemplo n.º 2
0
    def test_get_last_block_number_returns_zero_on_new_chain(
            self, mock_sanity_check, mock_storage_get):
        response = level_5_actions.get_last_block_number()

        mock_sanity_check.assert_called_once()
        mock_storage_get.assert_called_once_with("BROADCAST/LAST_BLOCK")
        self.assertEqual(response, "0")