Esempio n. 1
0
    def test_delete_accounts(self):
        """Test deleting an account from disk."""
        with custom_qiskitrc(), mock_ibmq_provider():
            IBMQ.save_account('QISKITRC_TOKEN')
            self.assertEqual(len(read_credentials_from_qiskitrc()), 1)

            IBMQ._accounts.clear()
            IBMQ.delete_accounts(token='QISKITRC_TOKEN')
            self.assertEqual(len(read_credentials_from_qiskitrc()), 0)
Esempio n. 2
0
 def test_delete_all_accounts(self):
     """Test deleting all accounts from disk."""
     with custom_qiskitrc(), mock_ibmq_provider():
         IBMQ.save_account('QISKITRC_TOKEN')
         IBMQ.save_account('QISKITRC_TOKEN',
                           url=IBMQ_TEMPLATE.format('a', 'b', 'c'))
         self.assertEqual(len(read_credentials_from_qiskitrc()), 2)
         IBMQ.delete_accounts()
         self.assertEqual(len(IBMQ._accounts), 0)
         self.assertEqual(len(read_credentials_from_qiskitrc()), 0)