From 5ec3ff2e231c6ec358133382b4789e3ed382b1ad Mon Sep 17 00:00:00 2001 From: Sanjeev Pandey Date: Wed, 25 Feb 2015 21:07:42 -0700 Subject: [PATCH 1/2] first few koans --- python2/koans/about_asserts.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python2/koans/about_asserts.py b/python2/koans/about_asserts.py index 476458337..c3bc825a9 100644 --- a/python2/koans/about_asserts.py +++ b/python2/koans/about_asserts.py @@ -15,26 +15,26 @@ def test_assert_truth(self): # # http://bit.ly/about_asserts - self.assertTrue(False) # This should be true + self.assertTrue(True) # This should be true def test_assert_with_message(self): """ Enlightenment may be more easily achieved with appropriate messages. """ - self.assertTrue(False, "This should be true -- Please fix this") + self.assertTrue(True,True) def test_fill_in_values(self): """ Sometimes we will ask you to fill in the values """ - self.assertEqual(__, 1 + 1) + self.assertEqual(2, 1 + 1) def test_assert_equality(self): """ To understand reality, we must compare our expectations against reality. """ - expected_value = __ + expected_value = 2 actual_value = 1 + 1 self.assertTrue(expected_value == actual_value) From 4407460fb2bc4adc832ef31e074ab398c28e11f2 Mon Sep 17 00:00:00 2001 From: Sanjeev Pandey Date: Thu, 26 Feb 2015 07:04:04 -0700 Subject: [PATCH 2/2] day2 --- python2/koans/about_asserts.py | 6 +++--- python2/koans/about_strings.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python2/koans/about_asserts.py b/python2/koans/about_asserts.py index c3bc825a9..9866ef8bc 100644 --- a/python2/koans/about_asserts.py +++ b/python2/koans/about_asserts.py @@ -42,7 +42,7 @@ def test_a_better_way_of_asserting_equality(self): """ Some ways of asserting equality are better than others. """ - expected_value = __ + expected_value = 2 actual_value = 1 + 1 self.assertEqual(expected_value, actual_value) @@ -53,7 +53,7 @@ def test_that_unittest_asserts_work_the_same_way_as_python_asserts(self): """ # This throws an AssertionError exception - assert False + assert True def test_that_sometimes_we_need_to_know_the_class_type(self): """ @@ -72,7 +72,7 @@ def test_that_sometimes_we_need_to_know_the_class_type(self): # # See for yourself: - self.assertEqual(__, "naval".__class__) # It's str, not + self.assertEqual(str, "naval".__class__) # It's str, not # Need an illustration? More reading can be found here: # diff --git a/python2/koans/about_strings.py b/python2/koans/about_strings.py index abfcf5981..4a6b62a02 100644 --- a/python2/koans/about_strings.py +++ b/python2/koans/about_strings.py @@ -8,11 +8,11 @@ class AboutStrings(Koan): def test_double_quoted_strings_are_strings(self): string = "Hello, world." - self.assertEqual(__, isinstance(string, basestring)) + self.assertEqual(True, isinstance(string, basestring)) def test_single_quoted_strings_are_also_strings(self): string = 'Goodbye, world.' - self.assertEqual(__, isinstance(string, basestring)) + self.assertEqual(True, isinstance(string, basestring)) def test_triple_quote_strings_are_also_strings(self): string = """Howdy, world!"""