Skip to content

Commit bf971bf

Browse files
committed
first pass
1 parent 45738bb commit bf971bf

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

koans/about_asserts.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,33 @@ def test_assert_truth(self):
1414
#
1515
# http://bit.ly/about_asserts
1616

17-
self.assertTrue(False) # This should be True
17+
self.assertTrue(True) # This should be True
1818

1919
def test_assert_with_message(self):
2020
"""
2121
Enlightenment may be more easily achieved with appropriate messages.
2222
"""
23-
self.assertTrue(False, "This should be True -- Please fix this")
23+
self.assertTrue(True, "This should be True -- Please fix this")
2424

2525
def test_fill_in_values(self):
2626
"""
2727
Sometimes we will ask you to fill in the values
2828
"""
29-
self.assertEqual(__, 1 + 1)
29+
self.assertEqual(2, 1 + 1)
3030

3131
def test_assert_equality(self):
3232
"""
3333
To understand reality, we must compare our expectations against reality.
3434
"""
35-
expected_value = __
35+
expected_value = 2
3636
actual_value = 1 + 1
3737
self.assertTrue(expected_value == actual_value)
3838

3939
def test_a_better_way_of_asserting_equality(self):
4040
"""
4141
Some ways of asserting equality are better than others.
4242
"""
43-
expected_value = __
43+
expected_value = 2
4444
actual_value = 1 + 1
4545

4646
self.assertEqual(expected_value, actual_value)
@@ -51,7 +51,7 @@ def test_that_unittest_asserts_work_the_same_way_as_python_asserts(self):
5151
"""
5252

5353
# This throws an AssertionError exception
54-
assert False
54+
assert True
5555

5656
def test_that_sometimes_we_need_to_know_the_class_type(self):
5757
"""
@@ -70,7 +70,7 @@ def test_that_sometimes_we_need_to_know_the_class_type(self):
7070
#
7171
# See for yourself:
7272

73-
self.assertEqual(__, "navel".__class__) # It's str, not <type 'str'>
73+
self.assertEqual(str, "navel".__class__) # It's str, not <type 'str'>
7474

7575
# Need an illustration? More reading can be found here:
7676
#

koans/about_strings.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,41 @@ 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 = """

0 commit comments

Comments
 (0)