-
Notifications
You must be signed in to change notification settings - Fork 0
/
testCalendar.py
59 lines (44 loc) · 1.48 KB
/
testCalendar.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import calendar
import testingMain
import singleton
s = singleton.Singleton.getInstance()
t = 4+6
print(s.foo + '{' + str(t) + "}")
class TestCalendar:
def __init__(self):
print("init TestCalendar")
print("[" + s.foo + "]")
def makeMonth(self):
c = calendar.TextCalendar(calendar.SUNDAY)
str = c.formatmonth(2019, 9)
print(str)
def htmlCalendar(self):
c = calendar.HTMLCalendar(calendar.SUNDAY)
str = c.formatmonth(2019, 9)
print(str)
def testCalendar(self):
print(calendar.calendar(2019, 2, 1, 6))
def testItermonthdates(self):
obj = calendar.Calendar()
# iteratign with itermonthdates
for day in obj.itermonthdates(2019, 9):
print(day)
def testMonthdayscalendar(self):
import calendar
obj = calendar.Calendar()
# iteratign with monthdayscalendar
for day in obj.monthdayscalendar(2019, 9):
print(day)
print('-------------------------------')
print(obj.monthdayscalendar(2019, 9)[0])
print(obj.monthdayscalendar(2019, 9)[1])
print(obj.monthdayscalendar(2019, 9)[2])
print(obj.monthdayscalendar(2019, 9)[3])
print(obj.monthdayscalendar(2019, 9)[4])
print(obj.monthdayscalendar(2019, 9)[5])
testCalendar = TestCalendar()
testCalendar.makeMonth()
testCalendar.htmlCalendar()
testCalendar.testCalendar()
testCalendar.testItermonthdates()
testCalendar.testMonthdayscalendar()