Skip to content

Commit

Permalink
fix qif tests (all passing)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomquirk committed Sep 14, 2017
1 parent 12e0415 commit a717e21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions lib/qif.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

import re
import os
import time


def get_qif_name(start_date, end_date):

date_format = '%Y.%m.%d'
start = time.strptime(start_date, "%d %b %y")
end = time.strptime(end_date, "%d %b %y")

return '%s - %s.qif' % (
start_date.strftime(date_format),
end_date.strftime(date_format)
return '%d.%d.%d - %d.%d.%d.qif' % (
start[0], start[1], start[2],
end[0], end[1], end[2],
)


Expand Down
4 changes: 2 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def setUp(self):

def test_get_qif_name(self):

name = qif.get_qif_name('01 Jan 10', '13 Apr 12')
self.assertEqual(name, '2010.01.01 - 2012.04.13.qif')
name = qif.get_qif_name('1 Jan 10', '13 Apr 12')
self.assertEqual(name, '2010.1.1 - 2012.4.13.qif')

def test_is_file_present(self):

Expand Down

0 comments on commit a717e21

Please sign in to comment.