bunq API Documentation
SDK'sPostman Collection
  • Getting Started
    • Welcome to the bunq API documentation
    • Tools
      • Software Development Kits (SDKs)
        • PHP
          • Usage
          • Tests
          • Exceptions
        • Java
          • Usage
          • Tests
          • Exceptions
        • Python
          • Usage
          • Tests
          • Exceptions
        • C#
          • Usage
          • Tests
          • Exceptions
      • Postman
      • Android Emulator
      • Developers Portal
  • Basics
    • bunq API Objects
      • User
      • Monetary Account
      • Payment
      • RequestInquiry
      • Card
      • Attachment and Note Attachment
    • API Context, Device Installation and Session
    • Authentication
      • API Keys
      • OAuth
    • Pagination
    • Errors
    • Rate Limits
    • Response body formatting
    • Moving to production
    • Headers
  • NOT SO BASICS
    • Signing
      • Python Code Example
        • Full main.py
        • Full bunq_lib.py
        • Full signing.py
      • PHP Code Example
    • Callbacks (Webhooks)
  • PSD2
    • Are you a Third Party Provider (TPP)? Start here!
      • Register as a TPP
      • Change your avatar
    • Account Information Service Provider (AISP)
    • Payment Initiation Service Provider (PISP)
    • Card-Based Payment Instrument Issuer (CBPII)
  • Support
    • FAQ
    • bunq status page
    • Terms and Conditions
  • TUTORIALS
    • Your first payment
      • Introduction
      • Creating a sandbox user and getting an API key
      • Creating the API Context
        • Creating the Installation
        • Device Registration
        • Start a Session
      • Setting up a sandbox user
        • Retrieving my user details
        • Getting sandbox money on the user account
        • Sandbox version of the bunq app
      • First Payments
    • Receiving payments on your website using bunq.me
    • How to manage your cards
      • Introduction
      • Ordering a card
      • Setting the card Limit and changing the PIN code
  • API Reference
    • Start here
    • Additional Transaction Information Category
    • Additional Transaction Information Category User Defined
    • Attachment
    • Attachment Public
    • Avatar
    • Billing Contract Subscription
    • bunqme
      • bunqme Tab
      • bunqme Fundraiser Profile
      • bunqme Tab Response
      • bunqme Fundraiser Result
    • Callback URL OAuth
    • Cards
      • Card
      • Card-Batch
      • Card Credit
      • Card Debit
      • Card Name
      • Card Replace
  • Confirmation Of Funds
  • Content and Exports
  • Currency Cloud
    • Currency cloud Benificiairy
    • Payment Quote
  • Currency Conversion
    • Convert
    • Quotes
  • Customer Statements
  • Devices
  • Draft Payment
  • Event
  • Exports
    • Export Annual Overview
    • Export RIB
    • Export Statement Card
  • Generated CVC2
  • Ideal Merchant Transaction
  • Insights
  • Installation
  • Invoice
  • Invoice Export
  • Legal Name
  • Limit
  • Mastercard Action
  • Monetary Account
    • Monetary Account Bank
    • Monetary Account Card
    • Monetary Account External
    • Monetary Account External Savings
    • Monetary Account Joint
    • Monetary Account Savings
    • Monetary Account Savings External
  • Name
  • Note Text & Attachment
    • Adyen Card Transaction
    • Switch Service Payment
    • bunqme fundraiser result
    • Draft Payment
    • Ideal Merchant Transaction
    • Mastercard Action
    • Open Banking Merchant
    • Payment Batch
    • Payment Delayed
    • Payment
    • Request Inquiry Batch
    • Request Response
    • Schedule Payment
    • Schedule Request
    • Sofort
    • Whitelist Result
  • Notification Filter
    • Notification Filter Email
    • Notification Filter Failure
    • Notification Filter Push
    • Notification Filter URL
  • OAuth
  • Payment
    • Payment
    • Payment Auto Allocate
    • Payment Batch
  • Payment Auto Allocation
  • Payment Service Provider
    • Payment Service Provider Credential
    • Payment Service Provider Draft Payment
    • Payment Service Provider Issuer Transaction
  • Request
    • Request Inquiry
    • Request Inquiry Batch
    • Request Response
  • Sandbox Users
  • Schedule
    • Schedule Instance
    • Schedule Payment
    • Schedule Payment Batch
  • Server Error
  • Server Public Key
  • Session
  • [deprecated] Share Invite Monetary Account Inquiry
  • Share Invite Monetary Account Response
  • Sofort Merchant Transaction
  • Statement
  • Switch Service Payment
  • Token QR Request Sofort
  • Transferwise
    • Transferwise Currency
    • Transferwise Quote
    • Transferwise Recipient
    • Transferwise Recipient Requirement
    • Transferwise Transfer
    • Transferwise Transfer Requirement
    • Transferwise User
  • Tree Progress
  • User
    • User Person
    • User Company
    • User Payment Service Provider
  • Whitelist SSD
    • Whitelist SSD One Off
    • Whitelist SSD Recurring
  • Content
Powered by GitBook
On this page
  • Scenarios
  • Configuration
  • Installation and Execution

Was this helpful?

  1. Getting Started
  2. Tools
  3. Software Development Kits (SDKs)
  4. Python

Tests

Currently we are not targeting the 100% test coverage, but rather want to be certain that the most common scenarios can run without any errors.

Scenarios

These are the scenarios that are currently being tested:

  • Create installation, session-server and device server

  • Create a new MonetaryAccount

  • Create a tab

  • Update the tab

  • Create attachment and avatar

  • Request money from first MA to second MA

  • Accept the request

  • Make a transaction from first MA to second MA

  • Create connect gr code

  • Make a payment to another sandbox user

  • Send a chat message in a recent payment

  • Delete the current session

  • Order a card with a second line

Besides these scenarios, some code of ApiContext, ApiClient and the JSON module are also tested :thumbs_up:.

Configuration

Note:

  • MONETARY_ACCOUNT_ID and MONETARY_ACCOUNT_ID2 must be of same user

  • CounterPartyOther must be of another Sandbox user

  • You can create a CASH_REGISTER_ID on doc.bunq.com

    1. Add your Developer Key to settings

    2. Upload an image to the Attachment Public endpoint

    3. Create an Avatar with the returned UUID

    4. Use the Avatar's UUID to create a Cash Register

    5. Copy the Cash Register's ID to the config.json

Installation and Execution

To run the tests, you must first generate a certificate and key. To do this run the following command, but first update "Your App Id" to a unique id.

openssl req -x509 -newkey rsa:4096 -keyout tests/key.pem -out tests/certificate.pem -days 365 -nodes -subj "/CN=Your App Id/C=NL" && \
echo -e "\n--- KEY ---\n" && cat tests/key.pem && \
echo -e "\n--- CERTIFICATE ---\n" && cat tests/certificate.pem

You can install all the required dependencies with the following command:

python setup.py install

You can run all the tests via command line:

python -m unittest discover -s tests/context && \
python -m unittest discover -s tests/http && \
python -m unittest discover -s tests/model/generated

or via PyCharm, but first you must configure PyCharm by doing the following:

  • Go to Preferences --> Tools --> Python integrated tools and change default test runner to unittests.

  • Configure your Python interpreter to an supported Python version. Python 3 is recommended.

Afterwards you can right click on the tests folders and should be able to run the tests cases form the IDE.

PreviousUsageNextExceptions

Last updated 24 days ago

Was this helpful?

To run the tests you must first setup the test configuration JSON. The example of a configuration file is located at . In order to make use of the configuration file, please copy the example to the same directory, fill in your sandbox user data and rename the copy to config.json.

tests/assets/config.example.json