summaryrefslogtreecommitdiff
path: root/integration-tests/json_checks.py
blob: 10a3d0b76906c0969dfdb9d1da025cfca16fc7ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python3

# This minimal library checks only if the JSON values
# contains the expected fields, without actually checking
# if the fields' value match the API.

from util import CheckJsonField as F, CheckJsonTop as T

def checkNewUserRequest(json):
    c = T(F("username"), F("password"))
    return c.check(json)

def checkNewEbicsConnection(json):
    c = T(
            F("source"),
            F("name"),
            F("type"),
            F("data", T(
                F("ebicsURL"),
                F("hostID"),
                F("partnerID"),
                F("userID"),
            ))
    )
    return c.check(json)

def checkImportAccount(json):
    c = T(F("nexusBankAccountId"), F("offeredAccountId"))
    return c.check(json)