-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestcaches.py
52 lines (44 loc) · 1.21 KB
/
testcaches.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
"""
>>> from class_logentry import logentry
>>> from class_cachelogs import cachelogs
>>> from class_cache import cache
>>> cache1 = cache("gctesti", "testcache")
>>> cache1.printcache()
Gccode : gctesti
Name : testcache
>>> cache1.gccode()
'gctesti'
>>> cache1.gcname()
'testcache'
>>> le1 = logentry(1234, "found", 210113, "asfd")
>>> le1.printlog()
(1234, 'logtype :', 'found', 'logdate :', 210113, 'logtext :', 'asfd...')
>>> le2 = logentry(2345, "found", 220214, "asdfjld")
>>> log1 = cachelogs(cache1)
>>> log1.add_logentry(le1)
# >>> log1.getNrOfLogEntries()
# 1
# >>> log1.print()
# Gccode : gctesti
# Name : testcache
# <BLANKLINE>
# (1234, 'logtype :', 'found', 'logdate :', 210113, 'logtext :', 'asfd...')
# <BLANKLINE>
>>> log1.add_logentry(le2)
# >>> log1.getNrOfLogEntries()
# 2
# >>> log1.print()
# Gccode : gctesti
# Name : testcache
# <BLANKLINE>
# (1234, 'logtype :', 'found', 'logdate :', 210113, 'logtext :', 'asfd...')
# <BLANKLINE>
# (2345, 'logtype :', 'found', 'logdate :', 220214, 'logtext :', 'asdfjld...')
# <BLANKLINE>
>>> le1.logtype()
'found'
>>> le1.logdate()
210113
>>> le1.logtxt()
'asfd'
"""