Beispiel #1
0
 def test_delete_success(self, size_filename_content_data):
     (size, filename, content) = size_filename_content_data
     file_storage = FileStorage(size)
     file = File(filename, content)
     file_storage.write(file)
     assert file_storage.delete(file.get_filename()) and file not in file_storage.get_files()
Beispiel #2
0
 def test_is_exists_return_true(self, size_filename_content_data):
     (size, filename, content) = size_filename_content_data
     file_storage = FileStorage(size)
     file = File(filename, content)
     file_storage.write(file)
     assert file_storage.is_exists(file.get_filename())
Beispiel #3
0
 def test_get_file_return_file(self, size_filename_content_data):
     (size, filename, content) = size_filename_content_data
     file_storage = FileStorage(size)
     file = File(filename, content)
     file_storage.write(file)
     assert file_storage.get_file(file.get_filename()) == file
 def test_get_filename(self, filename, content):
     file = File(filename, content)
     assert file.get_filename() == filename, "Invalid get_extension"