mirror of https://github.com/scrapy/scrapy.git
applied black to tests
This commit is contained in:
parent
42af2bf1ad
commit
a1e2fbafdc
|
|
@ -484,19 +484,18 @@ class FilesPipelineTestCaseCustomSettings(unittest.TestCase):
|
|||
self.assertEqual(getattr(pipeline_cls, pipe_inst_attr), expected_value)
|
||||
|
||||
def test_file_pipeline_using_pathlike_objects(self):
|
||||
|
||||
class CustomFilesPipelineWithPathLikeDir(FilesPipeline):
|
||||
def file_path(self, request, response=None, info=None, *, item=None):
|
||||
return Path('subdir') / Path(request.url).name
|
||||
return Path("subdir") / Path(request.url).name
|
||||
|
||||
pipeline = CustomFilesPipelineWithPathLikeDir.from_settings(
|
||||
Settings({'FILES_STORE': Path('./Temp')})
|
||||
Settings({"FILES_STORE": Path("./Temp")})
|
||||
)
|
||||
request = Request("http://example.com/image01.jpg")
|
||||
self.assertEqual(pipeline.file_path(request), Path('subdir/image01.jpg'))
|
||||
self.assertEqual(pipeline.file_path(request), Path("subdir/image01.jpg"))
|
||||
|
||||
def test_files_store_constructor_with_pathlike_object(self):
|
||||
path = Path('./FileDir')
|
||||
path = Path("./FileDir")
|
||||
fs_store = FSFilesStore(path)
|
||||
self.assertEqual(fs_store.basedir, str(path))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue