Beispiel #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')
     )
Beispiel #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')
     )
Beispiel #3
0
 def test_whitespace(self):
     self.assertFalse(
         LedgerThing.is_transaction_start('            \t    ')
     )
Beispiel #4
0
 def test_invalid_date(self):
     self.assertFalse(
         LedgerThing.is_transaction_start('2013/02/30 abc store')
     )
Beispiel #5
0
 def test_newline(self):
     line = '\n'
     self.assertFalse(
         LedgerThing.is_transaction_start(line)
     )
Beispiel #6
0
 def test_empty_line(self):
     self.assertFalse(LedgerThing.is_transaction_start(''))
Beispiel #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'))
Beispiel #8
0
 def test_leading_white_space(self):
     """leading whitespace should return false"""
     self.assertFalse(
         LedgerThing.is_transaction_start('    2013/04/14 abc store')
     )
Beispiel #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')
     )