Skip to content

Commit

Permalink
Merge pull request gregmalcolm#170 from kjc/with_context_manager
Browse files Browse the repository at this point in the history
Python 3 test_finding_lines2() assert passes as-is
  • Loading branch information
gregmalcolm authored Feb 13, 2018
2 parents 602498b + 875f163 commit ff7e4ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions python2/koans/about_with_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ def test_counting_lines2(self):
# ------------------------------------------------------------------

def find_line2(self, file_name):
# Rewrite find_line using the Context Manager.
pass
# Using the context manager self.FileContextManager, rewrite this
# function to return the first line containing the letter 'e'.
return None

def test_finding_lines2(self):
self.assertEqual(__, self.find_line2("example_file.txt"))
self.assertNotEqual(None, self.find_line2("example_file.txt"))
self.assertEqual('test\n', self.find_line2("example_file.txt"))

# ------------------------------------------------------------------

Expand Down
9 changes: 5 additions & 4 deletions python3/koans/about_with_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,13 @@ def test_counting_lines2(self):
# ------------------------------------------------------------------

def find_line2(self, file_name):
# Rewrite find_line using the Context Manager.
pass
# Using the context manager self.FileContextManager, rewrite this
# function to return the first line containing the letter 'e'.
return None

def test_finding_lines2(self):
self.assertEqual(__, self.find_line2("example_file.txt"))
self.assertNotEqual(__, self.find_line2("example_file.txt"))
self.assertNotEqual(None, self.find_line2("example_file.txt"))
self.assertEqual('test\n', self.find_line2("example_file.txt"))

# ------------------------------------------------------------------

Expand Down

0 comments on commit ff7e4ab

Please sign in to comment.