Ejemplo n.º 1
0
 def test_08_modify_user_transactions(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     response = fs.modify_user_transactions(False)
     [self.assertFalse(transaction.visited) for transaction in fs.transactions]
     response = fs.modify_user_transactions(True)
     [self.assertTrue(transaction.visited) for transaction in fs.transactions]
Ejemplo n.º 2
0
 def test_07_modify_account_transactions(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     account = fs.accounts[0]
     fs.modify_account_transactions(account.account_id, False)
     [self.assertFalse(transaction.visited) for transaction in account.transactions]
     fs.modify_account_transactions(account.account_id, True)
     [self.assertTrue(transaction.visited) for transaction in account.transactions]
Ejemplo n.º 3
0
 def test_09_delete_transaction(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     account = fs.accounts[0]
     transaction = account.transactions[0]
     transaction_count = len(account.transactions)
     fs.delete_transaction(account.account_id, transaction.transaction_id)
     self.assertEqual(transaction_count - 1, len(account.transactions))
Ejemplo n.º 4
0
 def test_09_delete_transaction(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     account = fs.accounts[0]
     transaction = account.transactions[0]
     transaction_count = len(account.transactions)
     fs.delete_transaction(account.account_id, transaction.transaction_id)
     self.assertEqual(transaction_count-1, len(account.transactions))
Ejemplo n.º 5
0
 def t_05_add_account(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     token = fs.add_account("de", self.CREDENTIALS, self.BANK_CODE)
     self.assertTrue(isinstance(token, TaskToken))
     task_state = fs.get_task_state(token)
     time.sleep(5)
     self.assertTrue(isinstance(task_state, TaskState))
     self.assertEqual(1, len(fs.accounts))
Ejemplo n.º 6
0
 def t_05_add_account(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     token = fs.add_account("de", self.CREDENTIALS, self.BANK_CODE)
     self.assertTrue(isinstance(token, TaskToken))
     task_state = fs.get_task_state(token)
     time.sleep(5)
     self.assertTrue(isinstance(task_state, TaskState))
     self.assertEqual(1, len(fs.accounts))
Ejemplo n.º 7
0
 def test_06_modify_transaction(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     account = fs.accounts[0]
     transaction = account.transactions[0]
     response = fs.modify_transaction(account.account_id, transaction.transaction_id, False)
     self.assertEqual(False, response.visited)
     response = fs.modify_transaction(account.account_id, transaction.transaction_id, True)
     self.assertEqual(True, response.visited)
Ejemplo n.º 8
0
 def test_06_modify_transaction(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     account = fs.accounts[0]
     transaction = account.transactions[0]
     response = fs.modify_transaction(account.account_id,
                                      transaction.transaction_id, False)
     self.assertEqual(False, response.visited)
     response = fs.modify_transaction(account.account_id,
                                      transaction.transaction_id, True)
     self.assertEqual(True, response.visited)
Ejemplo n.º 9
0
 def test_051_add_acount_and_sync_wrong_and_correct_pin(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     wrong_credentials = [self.CREDENTIALS[0], "123456"]
     try:
         task_state = fs.add_account_and_sync("de", wrong_credentials, self.BANK_CODE)
     except FigoPinException as pin_exception:
         task_state = fs.add_account_and_sync_with_new_pin(pin_exception, self.CREDENTIALS[1])
     time.sleep(5)
     self.assertTrue(isinstance(task_state, TaskState))
     self.assertEqual(1, len(fs.accounts))
Ejemplo n.º 10
0
 def test_051_add_acount_and_sync_wrong_and_correct_pin(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     wrong_credentials = [self.CREDENTIALS[0], "123456"]
     try:
         task_state = fs.add_account_and_sync("de", wrong_credentials,
                                              self.BANK_CODE)
     except FigoPinException as pin_exception:
         task_state = fs.add_account_and_sync_with_new_pin(
             pin_exception, self.CREDENTIALS[1])
     time.sleep(5)
     self.assertTrue(isinstance(task_state, TaskState))
     self.assertEqual(1, len(fs.accounts))
Ejemplo n.º 11
0
 def test_08_modify_user_transactions(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     response = fs.modify_user_transactions(False)
     [
         self.assertFalse(transaction.visited)
         for transaction in fs.transactions
     ]
     response = fs.modify_user_transactions(True)
     [
         self.assertTrue(transaction.visited)
         for transaction in fs.transactions
     ]
Ejemplo n.º 12
0
 def test_050_add_acount_and_sync_wrong_pin(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     wrong_credentials = [self.CREDENTIALS[0], "123456"]
     self.assertRaises(FigoPinException, fs.add_account_and_sync, "de",
                       wrong_credentials, self.BANK_CODE)
     self.assertEqual(0, len(fs.accounts))
Ejemplo n.º 13
0
 def test_07_modify_account_transactions(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     account = fs.accounts[0]
     fs.modify_account_transactions(account.account_id, False)
     [
         self.assertFalse(transaction.visited)
         for transaction in account.transactions
     ]
     fs.modify_account_transactions(account.account_id, True)
     [
         self.assertTrue(transaction.visited)
         for transaction in account.transactions
     ]
Ejemplo n.º 14
0
 def test_04_get_login_settings(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     login_settings = fs.get_login_settings("de", self.BANK_CODE)
     self.assertTrue(isinstance(login_settings, LoginSettings))
Ejemplo n.º 15
0
 def test_03_get_supported_payment_services(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     services = fs.get_supported_payment_services("de")
     self.assertEqual(21, len(services))
     self.assertTrue(isinstance(services[0], Service))
Ejemplo n.º 16
0
 def tearDownClass(cls):
     response = cls.fc.credential_login(cls.USER, cls.PASSWORD)
     fs = FigoSession(response["access_token"])
     fs.remove_user()
Ejemplo n.º 17
0
 def tearDownClass(cls):
     response = cls.fc.credential_login(cls.USER, cls.PASSWORD)
     fs = FigoSession(response["access_token"])
     fs.remove_user()
def test_create_token_and_session(figo_connection):
    token = figo_connection.credential_login(pytest.new_user_id, PASSWORD)
    pytest.token = token["access_token"]

    pytest.session = FigoSession(pytest.token)
    assert pytest.session.user.full_name == "Jimmy"
Ejemplo n.º 19
0
 def test_03_get_supported_payment_services(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     services = fs.get_supported_payment_services("de")
     self.assertEqual(21, len(services))
     self.assertTrue(isinstance(services[0], Service))
Ejemplo n.º 20
0
 def test_04_get_login_settings(self):
     response = self.fc.credential_login(self.USER, self.PASSWORD)
     fs = FigoSession(response["access_token"])
     login_settings = fs.get_login_settings("de", self.BANK_CODE)
     self.assertTrue(isinstance(login_settings, LoginSettings))
Ejemplo n.º 21
0
 def setUp(self):
     self.sut = FigoSession(
         "ASHWLIkouP2O6_bgA2wWReRhletgWKHYjLqDaqb0LFfamim9RjexTo22ujRIP_cjLiRiSyQXyt2kM1eXU2XLFZQ0Hro15HikJQT_eNeT_9XQ"
     )
def test_get_payments():
    session = FigoSession(pytest.payments_token)
    response = session.get_payments(pytest.account_id, None, None, None, None)
    assert response == []