Coverage for jbank/management/commands/test_xp.py : 50%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1from django.core.management.base import CommandParser
2from jbank.files import list_dir_files
3from jbank.sepa import Pain002
4from jutil.command import SafeCommand
7class Command(SafeCommand):
8 help = 'Parses pain.002 payment response .XP files'
10 def add_arguments(self, parser: CommandParser):
11 parser.add_argument('path', type=str)
12 parser.add_argument('--all', action='store_true')
14 def do(self, *args, **options):
15 files = list_dir_files(options['path'], '.XP')
16 for f in files:
17 print(f)
18 with open(f, 'rb') as fp:
19 p = Pain002(fp.read())
20 print(p) # pytype: disable=not-callable