Skip to content

Commit 7d764f7

Browse files
author
ttrmw
committed
finish about_decorating_with_classes.py
1 parent cbeeb99 commit 7d764f7

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

python2/koans/about_decorating_with_classes.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ def test_partial_that_wrappers_no_args(self):
2020
"""
2121
max = functools.partial(self.maximum)
2222

23-
self.assertEqual(__, max(7, 23))
24-
self.assertEqual(__, max(10, -10))
23+
self.assertEqual(23, max(7, 23))
24+
self.assertEqual(10, max(10, -10))
2525

2626
def test_partial_that_wrappers_first_arg(self):
2727
max0 = functools.partial(self.maximum, 0)
2828

29-
self.assertEqual(__, max0(-4))
30-
self.assertEqual(__, max0(5))
29+
self.assertEqual(0, max0(-4))
30+
self.assertEqual(5, max0(5))
3131

3232
def test_partial_that_wrappers_all_args(self):
3333
always99 = functools.partial(self.maximum, 99, 20)
3434
always20 = functools.partial(self.maximum, 9, 20)
3535

36-
self.assertEqual(__, always99())
37-
self.assertEqual(__, always20())
36+
self.assertEqual(99, always99())
37+
self.assertEqual(20, always20())
3838

3939
# ------------------------------------------------------------------
4040

@@ -65,8 +65,8 @@ def test_decorator_with_no_arguments(self):
6565
# To clarify: the decorator above the function has no arguments, even
6666
# if the decorated function does
6767

68-
self.assertEqual(__, self.foo())
69-
self.assertEqual(__, self.parrot('pieces of eight'))
68+
self.assertEqual('foo, foo', self.foo())
69+
self.assertEqual('PIECES OF EIGHT, PIECES OF EIGHT', self.parrot('pieces of eight'))
7070

7171
# ------------------------------------------------------------------
7272

@@ -78,7 +78,7 @@ def test_what_a_decorator_is_doing_to_a_function(self):
7878
#wrap the function with the decorator
7979
self.sound_check = self.doubleit(self.sound_check)
8080

81-
self.assertEqual(__, self.sound_check())
81+
self.assertEqual('Testing..., Testing...', self.sound_check())
8282

8383
# ------------------------------------------------------------------
8484

@@ -110,11 +110,11 @@ def idler(self, num):
110110
pass
111111

112112
def test_decorator_with_an_argument(self):
113-
self.assertEqual(__, self.count_badly(2))
114-
self.assertEqual(__, self.count_badly.__doc__)
113+
self.assertEqual(5, self.count_badly(2))
114+
self.assertEqual('Increments a value by one. Kind of.', self.count_badly.__doc__)
115115

116116
def test_documentor_which_already_has_a_docstring(self):
117-
self.assertEqual(__, self.idler.__doc__)
117+
self.assertEqual('Idler: Does nothing', self.idler.__doc__)
118118

119119
# ------------------------------------------------------------------
120120

@@ -125,5 +125,5 @@ def homer(self):
125125
return "D'oh"
126126

127127
def test_we_can_chain_decorators(self):
128-
self.assertEqual(__, self.homer())
129-
self.assertEqual(__, self.homer.__doc__)
128+
self.assertEqual("D'oh, D'oh, D'oh, D'oh", self.homer())
129+
self.assertEqual('DOH!', self.homer.__doc__)

0 commit comments

Comments
 (0)