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