def test_as_string(self): cnab = FebrabanCnab(self.branch, self.bank, self.info) cnab.add_record(FooRecord, foo=3) self.assertEqual(cnab.as_string(), '00003\r\n')
def test_total_records(self): cnab = FebrabanCnab(self.branch, self.bank, self.info) self.assertEqual(cnab.total_records, 0) cnab.add_record(FooRecord) self.assertEqual(cnab.total_records, 1)
def test_total_registries(self): cnab = FebrabanCnab(self.branch, self.bank, self.info) cnab.add_record(FebrabanCnab.FileHeader) cnab.add_record(FebrabanCnab.BatchHeader) cnab.add_record(FooRecord) cnab.add_record(FooRecord) cnab.add_record(FooRecord) bt = cnab.add_record(FebrabanCnab.BatchTrailer) cnab.add_record(FebrabanCnab.FileTrailer) self.assertEqual(bt.total_registries, 4)
def test_add_record(self): cnab = FebrabanCnab(self.branch, self.bank, self.info) record = cnab.add_record(FooRecord) self.assertEqual(record.get_value('bank_number'), 99)
def test_as_string(self): cnab = FebrabanCnab(self.branch, self.bank, self.info) cnab.add_record(FooRecord, foo=3) self.assertEqual(cnab.as_string(), '00003\r\n')
def test_total_registries(self): cnab = FebrabanCnab(self.branch, self.bank, self.info) cnab.add_record(FebrabanCnab.FileHeader) cnab.add_record(FebrabanCnab.BatchHeader) cnab.add_record(FooRecord) cnab.add_record(FooRecord) cnab.add_record(FooRecord) bt = cnab.add_record(FebrabanCnab.BatchTrailer) cnab.add_record(FebrabanCnab.FileTrailer) self.assertEqual(bt.total_registries, 4)
def test_total_records(self): cnab = FebrabanCnab(self.branch, self.bank, self.info) self.assertEqual(cnab.total_records, 0) cnab.add_record(FooRecord) self.assertEqual(cnab.total_records, 1)
def test_add_record(self): cnab = FebrabanCnab(self.branch, self.bank, self.info) record = cnab.add_record(FooRecord) self.assertEqual(record.get_value('bank_number'), 99)