Example #1
0
 def test_invalid_date_formats(self):
     self.assertFalse(
         LedgerThing.is_transaction_start('2013/5/12 abc store')
     )
     self.assertFalse(
         LedgerThing.is_transaction_start('2013/06/1 abc store')
     )
Example #2
0
 def test_transaction_code(self):
     self.assertTrue(
         LedgerThing.is_transaction_start('2016/10/20 (123) store')
     )
     self.assertTrue(
         LedgerThing.is_transaction_start('2016/10/20 (abc)store')
     )
     self.assertTrue(
         LedgerThing.is_transaction_start('2016/10/20 (123)')
     )
     self.assertTrue(
         LedgerThing.is_transaction_start('2016/10/20 (123)   ; xyz')
     )
     self.assertFalse(
         LedgerThing.is_transaction_start('2016/10/20(123)')
     )
     self.assertFalse(
         LedgerThing.is_transaction_start('2016/10/20someone')
     )
Example #3
0
 def test_whitespace(self):
     self.assertFalse(
         LedgerThing.is_transaction_start('            \t    ')
     )
Example #4
0
 def test_invalid_date(self):
     self.assertFalse(
         LedgerThing.is_transaction_start('2013/02/30 abc store')
     )
Example #5
0
 def test_newline(self):
     line = '\n'
     self.assertFalse(
         LedgerThing.is_transaction_start(line)
     )
Example #6
0
 def test_empty_line(self):
     self.assertFalse(LedgerThing.is_transaction_start(''))
Example #7
0
 def test_date_only(self):
     self.assertTrue(LedgerThing.is_transaction_start('2013/04/14 '))
     self.assertTrue(LedgerThing.is_transaction_start('2013/04/14'))
Example #8
0
 def test_leading_white_space(self):
     """leading whitespace should return false"""
     self.assertFalse(
         LedgerThing.is_transaction_start('    2013/04/14 abc store')
     )
Example #9
0
 def test_valid_transaction_start_with_tabs(self):
     """date recognized as the start of a transaction"""
     self.assertTrue(
         LedgerThing.is_transaction_start('2013/04/14\t\tabc store')
     )