From eba8a99ede9facd23e659cb58dcf01043b51086e Mon Sep 17 00:00:00 2001 From: Jules Date: Mon, 23 Jan 2017 12:53:06 +0000 Subject: [PATCH 1/5] completed 5 koans --- python2/koans/about_asserts.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python2/koans/about_asserts.py b/python2/koans/about_asserts.py index 8c80671d7..50ecbb94e 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, "This should be True -- Please fix this") 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) @@ -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) From cf8d1f9006f75b703713584ee65cc937f221c0a3 Mon Sep 17 00:00:00 2001 From: Jules Date: Mon, 23 Jan 2017 13:07:36 +0000 Subject: [PATCH 2/5] 10 koans completed --- python2/koans/about_asserts.py | 4 ++-- python2/koans/about_strings.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python2/koans/about_asserts.py b/python2/koans/about_asserts.py index 50ecbb94e..65cc9e992 100644 --- a/python2/koans/about_asserts.py +++ b/python2/koans/about_asserts.py @@ -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(__, "navel".__class__) # It's str, not + self.assertEqual(str, "navel".__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..5a05634e0 100644 --- a/python2/koans/about_strings.py +++ b/python2/koans/about_strings.py @@ -8,15 +8,15 @@ 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!""" - self.assertEqual(__, isinstance(string, basestring)) + self.assertEqual(True, isinstance(string, basestring)) def test_triple_single_quotes_work_too(self): string = '''Bonjour tout le monde!''' From cd75a012296130cbd314a8a838cf845c730ec92f Mon Sep 17 00:00:00 2001 From: Jules Date: Mon, 23 Jan 2017 13:10:06 +0000 Subject: [PATCH 3/5] 15 koans completed --- python2/koans/about_strings.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python2/koans/about_strings.py b/python2/koans/about_strings.py index 5a05634e0..c22f33c31 100644 --- a/python2/koans/about_strings.py +++ b/python2/koans/about_strings.py @@ -20,24 +20,24 @@ def test_triple_quote_strings_are_also_strings(self): def test_triple_single_quotes_work_too(self): string = '''Bonjour tout le monde!''' - self.assertEqual(__, isinstance(string, basestring)) + self.assertEqual(True, isinstance(string, basestring)) def test_raw_strings_are_also_strings(self): string = r"Konnichi wa, world!" - self.assertEqual(__, isinstance(string, basestring)) + self.assertEqual(True, isinstance(string, basestring)) def test_use_single_quotes_to_create_string_with_double_quotes(self): string = 'He said, "Go Away."' - self.assertEqual(__, string) + self.assertEqual('He said, "Go Away."', string) def test_use_double_quotes_to_create_strings_with_single_quotes(self): string = "Don't" - self.assertEqual(__, string) + self.assertEqual("Don't", string) def test_use_backslash_for_escaping_quotes_in_strings(self): a = "He said, \"Don't\"" b = 'He said, "Don\'t"' - self.assertEqual(__, (a == b)) + self.assertEqual(True, (a == b)) def test_use_backslash_at_the_end_of_a_line_to_continue_onto_the_next_line(self): string = "It was the best of times,\n\ From e57f7c2e5f32ed73e0b4548742c7159093b70bb4 Mon Sep 17 00:00:00 2001 From: Jules Date: Mon, 23 Jan 2017 13:17:20 +0000 Subject: [PATCH 4/5] 20 koans completed --- python2/koans/about_strings.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python2/koans/about_strings.py b/python2/koans/about_strings.py index c22f33c31..79beddd77 100644 --- a/python2/koans/about_strings.py +++ b/python2/koans/about_strings.py @@ -42,27 +42,27 @@ def test_use_backslash_for_escaping_quotes_in_strings(self): def test_use_backslash_at_the_end_of_a_line_to_continue_onto_the_next_line(self): string = "It was the best of times,\n\ It was the worst of times." - self.assertEqual(__, len(string)) + self.assertEqual(52, len(string)) def test_triple_quoted_strings_can_span_lines(self): string = """ Howdy, world! """ - self.assertEqual(__, len(string)) + self.assertEqual(15, len(string)) def test_triple_quoted_strings_need_less_escaping(self): a = "Hello \"world\"." b = """Hello "world".""" - self.assertEqual(__, (a == b)) + self.assertEqual(True, (a == b)) def test_escaping_quotes_at_the_end_of_triple_quoted_string(self): string = """Hello "world\"""" - self.assertEqual(__, string) + self.assertEqual("""Hello "world\"""", string) def test_plus_concatenates_strings(self): string = "Hello, " + "world" - self.assertEqual(__, string) + self.assertEqual("Hello, world", string) def test_adjacent_strings_are_concatenated_automatically(self): string = "Hello" ", " "world" From 1121fde5aaa7374b4caa3f99cde94a569afd11ec Mon Sep 17 00:00:00 2001 From: Jules Date: Mon, 23 Jan 2017 13:20:07 +0000 Subject: [PATCH 5/5] 25 koans completed --- python2/koans/about_strings.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python2/koans/about_strings.py b/python2/koans/about_strings.py index 79beddd77..c0bed40ef 100644 --- a/python2/koans/about_strings.py +++ b/python2/koans/about_strings.py @@ -66,30 +66,30 @@ def test_plus_concatenates_strings(self): def test_adjacent_strings_are_concatenated_automatically(self): string = "Hello" ", " "world" - self.assertEqual(__, string) + self.assertEqual("Hello, world", string) def test_plus_will_not_modify_original_strings(self): hi = "Hello, " there = "world" string = hi + there - self.assertEqual(__, hi) - self.assertEqual(__, there) + self.assertEqual("Hello, ", hi) + self.assertEqual("world", there) def test_plus_equals_will_append_to_end_of_string(self): hi = "Hello, " there = "world" hi += there - self.assertEqual(__, hi) + self.assertEqual("Hello, world", hi) def test_plus_equals_also_leaves_original_string_unmodified(self): original = "Hello, " hi = original there = "world" hi += there - self.assertEqual(__, original) + self.assertEqual("Hello, ", original) def test_most_strings_interpret_escape_characters(self): string = "\n" self.assertEqual('\n', string) self.assertEqual("""\n""", string) - self.assertEqual(__, len(string)) + self.assertEqual(1, len(string))