Skip to content

Commit c1974cf

Browse files
committed
Second koan
1 parent aadd442 commit c1974cf

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

python3/koans/about_strings.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,88 +7,88 @@ class AboutStrings(Koan):
77

88
def test_double_quoted_strings_are_strings(self):
99
string = "Hello, world."
10-
self.assertEqual(__, isinstance(string, str))
10+
self.assertEqual(True, isinstance(string, str))
1111

1212
def test_single_quoted_strings_are_also_strings(self):
1313
string = 'Goodbye, world.'
14-
self.assertEqual(__, isinstance(string, str))
14+
self.assertEqual(True, isinstance(string, str))
1515

1616
def test_triple_quote_strings_are_also_strings(self):
1717
string = """Howdy, world!"""
18-
self.assertEqual(__, isinstance(string, str))
18+
self.assertEqual(True, isinstance(string, str))
1919

2020
def test_triple_single_quotes_work_too(self):
2121
string = '''Bonjour tout le monde!'''
22-
self.assertEqual(__, isinstance(string, str))
22+
self.assertEqual(True, isinstance(string, str))
2323

2424
def test_raw_strings_are_also_strings(self):
2525
string = r"Konnichi wa, world!"
26-
self.assertEqual(__, isinstance(string, str))
26+
self.assertEqual(True, isinstance(string, str))
2727

2828
def test_use_single_quotes_to_create_string_with_double_quotes(self):
2929
string = 'He said, "Go Away."'
30-
self.assertEqual(__, string)
30+
self.assertEqual('He said, "Go Away."', string)
3131

3232
def test_use_double_quotes_to_create_strings_with_single_quotes(self):
3333
string = "Don't"
34-
self.assertEqual(__, string)
34+
self.assertEqual("Don't", string)
3535

3636
def test_use_backslash_for_escaping_quotes_in_strings(self):
3737
a = "He said, \"Don't\""
3838
b = 'He said, "Don\'t"'
39-
self.assertEqual(__, (a == b))
39+
self.assertEqual(True, (a == b))
4040

4141
def test_use_backslash_at_the_end_of_a_line_to_continue_onto_the_next_line(self):
4242
string = "It was the best of times,\n\
4343
It was the worst of times."
44-
self.assertEqual(__, len(string))
44+
self.assertEqual(52, len(string))
4545

4646
def test_triple_quoted_strings_can_span_lines(self):
4747
string = """
4848
Howdy,
4949
world!
5050
"""
51-
self.assertEqual(__, len(string))
51+
self.assertEqual(15, len(string))
5252

5353
def test_triple_quoted_strings_need_less_escaping(self):
5454
a = "Hello \"world\"."
5555
b = """Hello "world"."""
56-
self.assertEqual(__, (a == b))
56+
self.assertEqual(True, (a == b))
5757

5858
def test_escaping_quotes_at_the_end_of_triple_quoted_string(self):
5959
string = """Hello "world\""""
60-
self.assertEqual(__, string)
60+
self.assertEqual('Hello "world"', string)
6161

6262
def test_plus_concatenates_strings(self):
6363
string = "Hello, " + "world"
64-
self.assertEqual(__, string)
64+
self.assertEqual("Hello, world", string)
6565

6666
def test_adjacent_strings_are_concatenated_automatically(self):
6767
string = "Hello" ", " "world"
68-
self.assertEqual(__, string)
68+
self.assertEqual("Hello, world", string)
6969

7070
def test_plus_will_not_modify_original_strings(self):
7171
hi = "Hello, "
7272
there = "world"
7373
string = hi + there
74-
self.assertEqual(__, hi)
75-
self.assertEqual(__, there)
74+
self.assertEqual("Hello, ", hi)
75+
self.assertEqual("world", there)
7676

7777
def test_plus_equals_will_append_to_end_of_string(self):
7878
hi = "Hello, "
7979
there = "world"
8080
hi += there
81-
self.assertEqual(__, hi)
81+
self.assertEqual("Hello, world", hi)
8282

8383
def test_plus_equals_also_leaves_original_string_unmodified(self):
8484
original = "Hello, "
8585
hi = original
8686
there = "world"
8787
hi += there
88-
self.assertEqual(__, original)
88+
self.assertEqual("Hello, ", original)
8989

9090
def test_most_strings_interpret_escape_characters(self):
9191
string = "\n"
9292
self.assertEqual('\n', string)
9393
self.assertEqual("""\n""", string)
94-
self.assertEqual(__, len(string))
94+
self.assertEqual(1, len(string))

0 commit comments

Comments
 (0)