File tree 2 files changed +30
-11
lines changed
2 files changed +30
-11
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ def __init__(self):
38
38
def get_product_list (self ):
39
39
print ('PRODUCT LIST:' )
40
40
for product in self .business_logic .product_list ():
41
- print (product )
41
+ #print(product)
42
+ yield product
42
43
print ('' )
43
44
44
45
def get_product_information (self , product ):
Original file line number Diff line number Diff line change @@ -36,23 +36,40 @@ def __str__(self):
36
36
37
37
38
38
def test ():
39
- """Perform some decent tests, or rather: demos."""
39
+ """
40
+ Perform some decent tests, or rather: demos.
41
+ >>> print(Null())
42
+ Null
43
+ >>> print(Null('value'))
44
+ Null
45
+ >>> n= Null('vale',param='value')
46
+ >>> print(n)
47
+ Null
48
+ >>> n()
49
+ <Null>
50
+ >>> n('value')
51
+ <Null>
52
+ >>> n('value', param='value')
53
+ <Null>
54
+ >>> print(n)
55
+ Null
56
+ """
40
57
41
58
# constructing and calling
42
59
43
- n = Null ()
44
- print (n )
60
+ # n = Null()
61
+ # print(n)
45
62
46
- n = Null ('value' )
47
- print (n )
63
+ # n = Null('value')
64
+ # print(n)
48
65
49
66
n = Null ('value' , param = 'value' )
50
- print (n )
67
+ # print(n)
51
68
52
69
n ()
53
- n ('value' )
54
- n ('value' , param = 'value' )
55
- print (n )
70
+ # n('value')
71
+ # n('value', param='value')
72
+ # print(n)
56
73
57
74
# attribute handling
58
75
@@ -81,7 +98,8 @@ def test():
81
98
82
99
if __name__ == '__main__' :
83
100
test ()
84
-
101
+ import doctest
102
+ doctest .testmod ()
85
103
### OUTPUT ###
86
104
# Null
87
105
# Null
You can’t perform that action at this time.
0 commit comments