Skip to content

Commit

Permalink
print statements now python3 style, create user now uses a uuid as na…
Browse files Browse the repository at this point in the history
…me to avoid race conditions during parallel testing
  • Loading branch information
Berend Kapelle committed Mar 15, 2016
1 parent 5b671b9 commit 76bc28d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
6 changes: 3 additions & 3 deletions console_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ def main():

# print out a list of accounts including its balance
for account in session.accounts:
print account
print account.balance
print(account)
print(account.balance)

# print out the list of all transactions on a specific account
for transaction in session.get_account("A1.2").transactions:
print transaction
print(transaction)

if __name__ == "__main__":
main()
8 changes: 4 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ Retrieving some data is very easy using the demo access from above:
# print out a list of accounts including its balance
for account in session.accounts:
print account
print account.balance
print(account)
print(account.balance)
# print out the list of all transactions on a specific account
for transaction in session.get_account("A1.2").transactions:
print transaction
print(transaction)
It is just as simple to allow users to login through the API:
Expand Down Expand Up @@ -71,7 +71,7 @@ It is just as simple to allow users to login through the API:
# access data
for account in session.accounts:
print account.name
print(account.name)
Module Documentation
Expand Down
11 changes: 8 additions & 3 deletions tests/test_writing_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from figo.figo import FigoConnection, FigoSession, FigoPinException
from figo.models import TaskToken, TaskState, Service, LoginSettings
import time
from uuid import uuid4


class WriteTest(unittest.TestCase):
Expand All @@ -31,10 +32,15 @@ def tearDownClass(cls):
fs.remove_user()

def t_01_add_user(self):
response = self.fc.add_user("Test", self.USER, self.PASSWORD)
username = "{0}[email protected]".format(uuid4())
response = self.fc.add_user("Test", username, self.PASSWORD)
self.assertTrue(isinstance(response, (str, unicode)))

response = self.fc.credential_login(username, self.PASSWORD)
session = FigoSession(response["access_token"])
session.remove_user()

def test_010_add_user_and_login(self):

response = self.fc.add_user_and_login("Test", self.USER, self.PASSWORD)
self.assertTrue("access_token" in response)

Expand All @@ -46,7 +52,6 @@ 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")
print services
self.assertEqual(26, len(services))
self.assertTrue(isinstance(services[0], Service))

Expand Down

0 comments on commit 76bc28d

Please sign in to comment.