def test_parse_without_transactions(self): lines = [ '03,0975312468,GBP,010,500000,,,190,70000000,4,0/', '49,70500000,2/' ] parser = AccountParser(IteratorHelper(lines)) account = parser.parse() self.assertEqual(len(account.children), 0)
def test_ignore_integrity_checks(self): """ Checks that if IGNORE_INTEGRITY_CHECKS is set, integrity checks are not performed. """ lines = [ '03,0975312468,GBP,010,500000,,,190,70000000,4,0/', '16,165,1500000,1,DD1620,, DEALER PAYMENTS', '49,72000001,3/' ] parser = AccountParser(IteratorHelper(lines), check_integrity=False) account = parser.parse() self.assertTrue(isinstance(account, Account))
def test_parse_with_multiple_transactions(self): lines = [ '03,0975312468,GBP,010,500000,,,190,70000000,4,0/', '16,165,1500000,1,DD1620,, DEALER PAYMENTS', '16,115,10000000,S,5000000,4000000,1000000/', '88,AX13612,B096132,AMALGAMATED CORP. LOCKBOX', '88,DEPOSIT-MISC. RECEIVABLES', '49,82000000,6/' ] parser = AccountParser(IteratorHelper(lines)) account = parser.parse() self.assertEqual(len(account.children), 2)
def test_parse(self): lines = [ '03,0975312468,GBP,010,500000,,,190,70000000,4,0/', '16,165,1500000,1,DD1620,, DEALER PAYMENTS', '49,72000000,3/' ] parser = AccountParser(IteratorHelper(lines)) account = parser.parse() header = account.header self.assertEqual(header.customer_account_number, '0975312468') self.assertEqual(header.currency, 'GBP') trailer = account.trailer self.assertEqual(trailer.account_control_total, 72000000) self.assertEqual(trailer.number_of_records, 3) self.assertEqual(len(account.children), 1)