Exemple #1
0
 def test_read_returns_file_contents(self):
     contents = file.read(self.sample_file_name)
     self.assertEqual(contents, self.sample_file_contents,
         "Failed to read file contents - expected '{}', got '{}'".format(
             self.sample_file_contents, contents))
Exemple #2
0
 def test_read_nonexistent_path_raises_InvalidPath_error(self):
     with self.assertRaises(errors.InvalidPath):
         file.read('/foo/bar/NonExistentFile.txt')