Skip to content

Commit f888fad

Browse files
author
Lucy Bain
committed
Learning about asserts
1 parent 70b98f5 commit f888fad

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

python2/koans/about_asserts.py

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

18-
self.assertTrue(False) # This should be True
18+
self.assertTrue(True) # This should be True
1919

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

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

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

4141
def test_a_better_way_of_asserting_equality(self):
4242
"""
4343
Some ways of asserting equality are better than others.
4444
"""
45-
expected_value = __
45+
expected_value = 2
4646
actual_value = 1 + 1
4747

4848
self.assertEqual(expected_value, actual_value)
@@ -53,7 +53,7 @@ def test_that_unittest_asserts_work_the_same_way_as_python_asserts(self):
5353
"""
5454

5555
# This throws an AssertionError exception
56-
assert False
56+
assert True
5757

5858
def test_that_sometimes_we_need_to_know_the_class_type(self):
5959
"""
@@ -72,7 +72,7 @@ def test_that_sometimes_we_need_to_know_the_class_type(self):
7272
#
7373
# See for yourself:
7474

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

7777
# Need an illustration? More reading can be found here:
7878
#

0 commit comments

Comments
 (0)