From 790a18dfe2714af420778a09b19fb68b19277601 Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 24 Jan 2020 08:36:48 -0300 Subject: [PATCH] Completed the about_monkey_patching koan --- python2/koans/about_monkey_patching.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python2/koans/about_monkey_patching.py b/python2/koans/about_monkey_patching.py index 65bd461d9..6a50afb3f 100644 --- a/python2/koans/about_monkey_patching.py +++ b/python2/koans/about_monkey_patching.py @@ -15,7 +15,7 @@ def bark(self): def test_as_defined_dogs_do_bark(self): fido = self.Dog() - self.assertEqual(__, fido.bark()) + self.assertEqual("WOOF", fido.bark()) # ------------------------------------------------------------------ @@ -27,8 +27,8 @@ def wag(self): self.Dog.wag = wag fido = self.Dog() - self.assertEqual(__, fido.wag()) - self.assertEqual(__, fido.bark()) + self.assertEqual("HAPPY", fido.wag()) + self.assertEqual("WOOF", fido.bark()) # ------------------------------------------------------------------ @@ -36,7 +36,7 @@ def test_most_built_in_classes_cannot_be_monkey_patched(self): try: int.is_even = lambda self: (self % 2) == 0 except StandardError as ex: - self.assertMatch(__, ex[0]) + self.assertMatch("can't set attributes of built-in/extension type 'int'", ex[0]) # ------------------------------------------------------------------ @@ -46,5 +46,5 @@ class MyInt(int): def test_subclasses_of_built_in_classes_can_be_be_monkey_patched(self): self.MyInt.is_even = lambda self: (self % 2) == 0 - self.assertEqual(____, self.MyInt(1).is_even()) - self.assertEqual(____, self.MyInt(2).is_even()) + self.assertEqual(False, self.MyInt(1).is_even()) + self.assertEqual(True, self.MyInt(2).is_even())