Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_Users_CreateKycPage_CorrectFilePath(self) :
user = self.getJohn()
kycDocumentInit = KycDocument()
kycDocumentInit.Status = KycDocumentStatus.CREATED
kycDocumentInit.Type = KycDocumentType.IDENTITY_PROOF
kycDocument = self.sdk.users.CreateUserKycDocument(kycDocumentInit, user.Id)
self.sdk.users.CreateKycPageFromFile(user.Id, kycDocument.Id, os.path.join(os.path.dirname(__file__), "TestKycPageFile.png"))
def test_KycDocuments_GetAll(self):
kycDocument = self.getUserKycDocument()
pagination = Pagination(1, 100)
self.sdk.kycdocuments.GetAll(pagination)
pagination.Page = pagination.TotalPages
list = self.sdk.kycdocuments.GetAll(pagination)
kycFromList = self.getEntityFromList(kycDocument.Id, list)
self.assertTrue(isinstance(kycFromList, KycDocument))
self.assertEqualInputProps(kycDocument, kycFromList)
self.assertEqual(pagination.ItemsPerPage, 100)
def getUserKycDocument(self):
"""Creates KycDocument
return KycDocument
"""
if (self._johnsKycDocument == None):
user = self.getJohn()
kycDocument = KycDocument()
kycDocument.Tag = 'test tag 1'
kycDocument.Type = KycDocumentType.IDENTITY_PROOF
kycDocument.UserId = user.Id
self._johnsKycDocument = self.sdk.users.CreateUserKycDocument(kycDocument, user.Id)
return self._johnsKycDocument
def test_Users_CreateKycPage_EmptyFilePath(self):
user = self.getJohn()
kycDocumentInit = KycDocument()
kycDocumentInit.Status = KycDocumentStatus.CREATED
kycDocumentInit.Type = KycDocumentType.IDENTITY_PROOF
kycDocument = self.sdk.users.CreateUserKycDocument(kycDocumentInit, user.Id)
try:
self.sdk.users.CreateKycPageFromFile(user.Id, kycDocument.Id, '')
except Exception as exc:
self.assertEqual(str(exc), 'Path of file cannot be empty')
self.assertEqualInputProps(entity1.Fees, entity2.Fees)
elif (isinstance(entity1, PayOutPaymentDetailsBankWire)):
self.assertEqual(entity1.BankAccountId, entity2.BankAccountId)
elif (isinstance(entity1, Transaction)):
self.assertEqual(entity1.Tag, entity2.Tag)
self.assertEqualInputProps(entity1.DebitedFunds, entity2.DebitedFunds)
self.assertEqualInputProps(entity1.CreditedFunds, entity2.CreditedFunds)
self.assertEqualInputProps(entity1.Fees, entity2.Fees)
self.assertEqual(entity1.Status, entity2.Status)
elif (isinstance(entity1, Money)):
self.assertEqual(entity1.Currency, entity2.Currency)
self.assertEqual(entity1.Amount, entity2.Amount)
elif (isinstance(entity1, KycDocument)):
self.assertEqual(entity1.Type, entity2.Type)
self.assertEqual(entity1.Status, entity2.Status)
self.assertEqual(entity1.UserId, entity2.UserId)
else:
raise Exception("Unsupported type")
def test_Users_GetKycDocuments(self):
kycDocument = self.getUserKycDocument()
user = self.getJohn()
pagination = Pagination(1, 10)
self.sdk.users.GetKycDocuments(user.Id, pagination)
pagination.Page = pagination.TotalPages
getKycDocuments = self.sdk.users.GetKycDocuments(user.Id, pagination)
kycFromList = self.getEntityFromList(kycDocument.Id, getKycDocuments)
self.assertIsInstance(kycFromList, KycDocument)
self.assertEqualInputProps(kycDocument, kycFromList)
def test_Users_CreateKycPage_WrongFilePath(self) :
user = self.getJohn()
kycDocumentInit = KycDocument()
kycDocumentInit.Status = KycDocumentStatus.CREATED
kycDocumentInit.Type = KycDocumentType.IDENTITY_PROOF
kycDocument = self.sdk.users.CreateUserKycDocument(kycDocumentInit, user.Id)
try:
self.sdk.users.CreateKycPageFromFile(user.Id, kycDocument.Id, 'notExistFileName.tmp')
except Exception as exc:
self.assertEqual(str(exc), 'File not exist: notExistFileName.tmp')
def __init__(self, id = None):
self.Tag = ''
self.UserId = None
# KycDocumentType:
self.Type = None
# KycDocumentStatus
self.Status = None
# timestamp
self.CreationDate = None
self.RefusedReasonType = None
self.RefusedReasonMessage = None
return super(KycDocument, self).__init__(id)