def test_preserves_leading_whitespace(self):
     self._create_test_file("   has leading whitespace")
     self.assertEqual("   has leading whitespace",
                      base_utils.read_one_line("filename"))
 def test_works_on_file_with_no_newlines(self):
     self._create_test_file("line but no newline")
     self.assertEqual("line but no newline",
                      base_utils.read_one_line("filename"))
     self.god.check_playback()
 def test_drops_extra_lines(self):
     self._create_test_file("line 1\nline 2\nline 3\n")
     self.assertEqual("line 1", base_utils.read_one_line("filename"))
     self.god.check_playback()
 def test_works_on_empty_file(self):
     self._create_test_file("")
     self.assertEqual("", base_utils.read_one_line("filename"))
     self.god.check_playback()
 def test_strips_read_lines(self):
     self._create_test_file("abc   \n")
     self.assertEqual("abc   ", base_utils.read_one_line("filename"))
     self.god.check_playback()