Skip to content

Commit

Permalink
Add test unit, see the issue #6
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Jun 3, 2014
1 parent 0502833 commit 895d430
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/generate-calendar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/python3

import sys
sys.path.append('../')
from pyIslam.hijri import HijriDate


year = 1
hi = HijriDate(year, 1, 1)
days = list()
days.append(list())

while hi.year < 1435:
next_hi = hi.nextDate()
if next_hi.year != hi.year:
days.append(list())

if next_hi.isLast():
days[next_hi.year - year].append \
('%04d-%02d = %d' % (next_hi.year, next_hi.month, next_hi.day))

del hi
hi = next_hi

for day in days:
print(day)

0 comments on commit 895d430

Please sign in to comment.