Skip to content

Commit

Permalink
Merge branch 'luoxing91-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
faif committed May 5, 2014
2 parents ba8afd7 + ab2a3e5 commit 37b11da
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
3 changes: 2 additions & 1 deletion 3-tier.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def __init__(self):
def get_product_list(self):
print('PRODUCT LIST:')
for product in self.business_logic.product_list():
print(product)
#print(product)
yield product
print('')

def get_product_information(self, product):
Expand Down
38 changes: 28 additions & 10 deletions null.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,40 @@ def __str__(self):


def test():
"""Perform some decent tests, or rather: demos."""
"""
Perform some decent tests, or rather: demos.
>>> print(Null())
Null
>>> print(Null('value'))
Null
>>> n= Null('vale',param='value')
>>> print(n)
Null
>>> n()
<Null>
>>> n('value')
<Null>
>>> n('value', param='value')
<Null>
>>> print(n)
Null
"""

# constructing and calling

n = Null()
print(n)
#n = Null()
#print(n)

n = Null('value')
print(n)
#n = Null('value')
#print(n)

n = Null('value', param='value')
print(n)
#print(n)

n()
n('value')
n('value', param='value')
print(n)
#n('value')
#n('value', param='value')
#print(n)

# attribute handling

Expand Down Expand Up @@ -81,7 +98,8 @@ def test():

if __name__ == '__main__':
test()

import doctest
doctest.testmod()
### OUTPUT ###
# Null
# Null
Expand Down

0 comments on commit 37b11da

Please sign in to comment.