def test_assigned_thing_numbers(self): """thing numbers added in sequence starting at one""" testdata = '''; blah ; blah blah blah 2013/05/06 payee name expenses: misc liabilities: credit card $-50 ''' tempfile = FileTester.create_temp_file(testdata) ledgerfile = LedgerFile(tempfile) remove(tempfile) thing = LedgerThing([ '2011/01/01 beezlebub', ' assets: soul', ' liabilities: credit card $666', ]) ledgerfile.add_thing(thing) expected = '012' actual = '' for thing in ledgerfile.get_things(): actual += str(thing.thing_number) self.assertEquals(actual, expected)