File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,12 +91,13 @@ def test_counting_lines2(self):
9191 # ------------------------------------------------------------------
9292
9393 def find_line2 (self , file_name ):
94- # Rewrite find_line using the Context Manager.
95- pass
94+ # Using the context manager self.FileContextManager, rewrite this
95+ # function to return the first line containing the letter 'e'.
96+ return None
9697
9798 def test_finding_lines2 (self ):
98- self .assertEqual (__ , self .find_line2 ("example_file.txt" ))
9999 self .assertNotEqual (None , self .find_line2 ("example_file.txt" ))
100+ self .assertEqual ('test\n ' , self .find_line2 ("example_file.txt" ))
100101
101102 # ------------------------------------------------------------------
102103
Original file line number Diff line number Diff line change @@ -90,12 +90,13 @@ def test_counting_lines2(self):
9090 # ------------------------------------------------------------------
9191
9292 def find_line2 (self , file_name ):
93- # Rewrite find_line using the Context Manager.
94- pass
93+ # Using the context manager self.FileContextManager, rewrite this
94+ # function to return the first line containing the letter 'e'.
95+ return None
9596
9697 def test_finding_lines2 (self ):
97- self .assertEqual ( __ , self .find_line2 ("example_file.txt" ))
98- self .assertNotEqual ( __ , self .find_line2 ("example_file.txt" ))
98+ self .assertNotEqual ( None , self .find_line2 ("example_file.txt" ))
99+ self .assertEqual ( 'test \n ' , self .find_line2 ("example_file.txt" ))
99100
100101 # ------------------------------------------------------------------
101102
You can’t perform that action at this time.
0 commit comments