File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
src/apify/storage_clients/_file_system
tests/unit/storage_clients Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -30,10 +30,7 @@ async def purge(self) -> None:
30
30
31
31
# First try to find the alternative format of the input file and process it if it exists.
32
32
for file_path in self .path_to_kvs .glob ('*' ):
33
- if (
34
- file_path .name in configuration .input_key_candidates
35
- and file_path .name != configuration .canonical_input_key
36
- ):
33
+ if file_path .name in configuration .input_key_candidates :
37
34
await self ._process_input_json (file_path )
38
35
39
36
async with self ._lock :
Original file line number Diff line number Diff line change 4
4
import json
5
5
from typing import TYPE_CHECKING
6
6
7
+ import pytest
8
+
7
9
from crawlee ._consts import METADATA_FILENAME
8
10
9
11
from apify import Actor , Configuration
@@ -64,16 +66,16 @@ async def test_purge_preserves_input_file_and_metadata() -> None:
64
66
assert input_content == '{"test": "input"}'
65
67
66
68
67
- async def test_pre_existing_input_used_by_actor (tmp_path : Path ) -> None :
69
+ @pytest .mark .parametrize ('input_file_name' , ['INPUT' , 'INPUT.json' ])
70
+ async def test_pre_existing_input_used_by_actor (tmp_path : Path , input_file_name : str ) -> None :
68
71
pre_existing_input = {
69
72
'foo' : 'bar' ,
70
73
}
71
74
72
- configuration = Configuration .get_global_configuration ()
73
75
# Create pre-existing INPUT.json file
74
76
path_to_input = tmp_path / 'key_value_stores' / 'default'
75
77
path_to_input .mkdir (parents = True )
76
- (path_to_input / f' { configuration . input_key } .json' ).write_text (json .dumps (pre_existing_input ))
78
+ (path_to_input / input_file_name ).write_text (json .dumps (pre_existing_input ))
77
79
78
80
async with Actor ():
79
81
assert pre_existing_input == await Actor .get_input ()
You can’t perform that action at this time.
0 commit comments