Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assans #247

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions koans/about_asserts.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ 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)

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)
Expand All @@ -51,7 +51,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):
"""
Expand All @@ -70,7 +70,7 @@ def test_that_sometimes_we_need_to_know_the_class_type(self):
#
# See for yourself:

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

# Need an illustration? More reading can be found here:
#
Expand Down