コード例 #1
0
    def test_wireup(self):
        """
        Verify that the command is wired up correctly.

        The API method indeed calls the appropiate command.
        """
        with patch(
                'iota.commands.core.check_consistency.CheckConsistencyCommand.__call__',
                MagicMock(return_value='You found me!')) as mocked_command:

            api = Iota(self.adapter)

            # Don't need to call with proper args here.
            response = api.check_consistency('tails')

            self.assertTrue(mocked_command.called)

            self.assertEqual(response, 'You found me!')
コード例 #2
0
from iota import Iota
from config import NODE_URL
import json

TXN_HASH = "CLTQFSGD9KJHZPUOJEMKWDZRGMKUHAAGAXFWXNJNZRKGWCXBFNBIW9SZZ9LPWGGNOBHOQWAVEPEH99999"

api = Iota(NODE_URL)
print(api.check_consistency([TXN_HASH]))