Example #1
0
def test_create_process_from_dict(figo_session):
    data = {
        "email": "*****@*****.**",
        "password": "******",
        "state": "123",
        "steps": [
            {
                "options": {},
                "type": "figo.steps.account.create"
            },
            {
                "options": {
                    "account_number": "100100100",
                    "amount": 99,
                    "bank_code": "82051000",
                    "currency": "EUR",
                    "name": "Figo GmbH",
                    "purpose": "Yearly contribution",
                    "type": "Transfer"
                },
                "type": "figo.steps.payment.submit"
            }
        ]
    }
    process = Process.from_dict(figo_session, data)
    assert isinstance(process, Process)
Example #2
0
 def test_create_process_from_dict(self):
     data = {
         "email":
         "*****@*****.**",
         "password":
         "******",
         "state":
         "123",
         "steps": [{
             "options": {},
             "type": "figo.steps.account.create"
         }, {
             "options": {
                 "account_number": "100100100",
                 "amount": 99,
                 "bank_code": "82051000",
                 "currency": "EUR",
                 "name": "Figo GmbH",
                 "purpose": "Yearly contribution",
                 "type": "Transfer"
             },
             "type": "figo.steps.payment.submit"
         }]
     }
     process = Process.from_dict(self.sut, data)
     self.assertTrue(isinstance(process, Process))
Example #3
0
 def test_create_process(self):
     # Access token with process=rw needed
     process = Process(self.sut,
                       email="*****@*****.**",
                       password="******",
                       state="qwer",
                       steps=["not_valid"])
     self.assertRaises(FigoException, self.sut.create_process, process)
def test_create_process(demo_session):
    # Access token with process=rw needed
    process = Process(demo_session,
                      email="*****@*****.**",
                      password="******",
                      state="qwer",
                      steps=["not_valid"])

    with pytest.raises(FigoException):
        demo_session.create_process(process)