27 lines
No EOL
517 B
Python
27 lines
No EOL
517 B
Python
from storage.basestorage import BaseStorage
|
|
|
|
|
|
class FakeStorage(BaseStorage):
|
|
def _init_path(self, path=None, create=False):
|
|
return path
|
|
|
|
def get_content(self, path):
|
|
raise IOError('Fake files are fake!')
|
|
|
|
def put_content(self, path, content):
|
|
return path
|
|
|
|
def stream_read(self, path):
|
|
yield ''
|
|
|
|
def stream_write(self, path, fp, content_type=None):
|
|
pass
|
|
|
|
def remove(self, path):
|
|
pass
|
|
|
|
def exists(self, path):
|
|
return False
|
|
|
|
def get_checksum(self, path):
|
|
return 'abcdefg' |