예제 #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
    def test_wireup(self):
        """
    Verify that the command is wired up correctly. (sync)

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

            api = Iota(self.adapter)

            response = api.get_inclusion_states('transactions', 'tips')

            self.assertTrue(mocked_command.called)

            self.assertEqual(response, 'You found me!')
예제 #3
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.extended.is_reattachable.IsReattachableCommand.__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.is_reattachable('addresses')

            self.assertTrue(mocked_command.called)

            self.assertEqual(response, 'You found me!')
    async def test_wireup_async(self):
        """
        Verify that the command is wired up correctly. (async)

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

            api = AsyncIota(self.adapter)

            response = await api.get_transactions_to_approve('depth')

            self.assertTrue(mocked_command.called)

            self.assertEqual(response, 'You found me!')
예제 #5
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.extended.get_transaction_objects.GetTransactionObjectsCommand.__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.get_transaction_objects('hashes')

            self.assertTrue(mocked_command.called)

            self.assertEqual(response, 'You found me!')
예제 #6
0
    async def test_wireup_async(self):
        """
    Verify that the command is wired up correctly. (async)

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

            api = AsyncMultisigIota(self.adapter)

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

            self.assertTrue(mocked_command.called)

            self.assertEqual(response, 'You found me!')
예제 #7
0
    def test_wireup(self):
        """
    Verify that the command is wired up correctly. (sync)

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

            api = Iota(self.adapter)

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

            self.assertTrue(mocked_command.called)

            self.assertEqual(response, 'You found me!')
예제 #8
0
    async def test_wireup_async(self):
        """
    Verify that the command is wired up correctly. (async)

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

            api = AsyncIota(self.adapter)

            # Don't need to call with proper args here.
            response = await api.send_trytes('trytes')

            self.assertTrue(mocked_command.called)

            self.assertEqual(response, 'You found me!')
예제 #9
0
    def test_wireup(self):
        """
    Verify that the command is wired up correctly. (sync)

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

            api = MultisigIota(self.adapter)

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

            self.assertTrue(mocked_command.called)

            self.assertEqual(response, 'You found me!')
예제 #10
0
    def test_wireup(self):
        """
    Verify that the command is wired up correctly.

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

            api = MultisigIota(self.adapter)

            # Don't need to call with proper args here.
            response = api.prepare_multisig_transfer('transfer',
                                                     'multisig_input')

            self.assertTrue(mocked_command.called)

            self.assertEqual(response, 'You found me!')
예제 #11
0
    async def test_wireup_async(self):
        """
        Verify that the command is wired up correctly. (async)

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

            api = AsyncIota(self.adapter)

            response = await api.check_consistency('tails')

            self.assertTrue(mocked_command.called)

            self.assertEqual(
                response,
                'You found me!'
            )
예제 #12
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.interrupt_attaching_to_tangle.InterruptAttachingToTangleCommand.__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.interrupt_attaching_to_tangle()

      self.assertTrue(mocked_command.called)

      self.assertEqual(
        response,
        'You found me!'
      )