Created
December 3, 2020 14:56
-
-
Save rishabhc32/3e6b4fcda62d984033cf62962b31bc39 to your computer and use it in GitHub Desktop.
Mock PAN extraction library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randrange | |
class BackendError(Exception): | |
pass | |
def get_pan_data(pan_number): | |
num = randrange(10) | |
if num in (8,9): | |
raise BackendError | |
return { | |
'pan': pan_number, | |
'name': 'Dinesh Kumar', | |
'dob': '25-10-1990', | |
'father_name': 'Hari Kumar' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment