File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
aws_doc_sdk_examples_tools/lliam/test Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ from pathlib import Path
2+
3+ from aws_doc_sdk_examples_tools .fs import RecordFs
4+ from aws_doc_sdk_examples_tools .lliam .adapters .repository import PromptRepository
5+ from aws_doc_sdk_examples_tools .lliam .domain .model import Prompt
6+
7+
8+ def test_batch_naming_occurs_properly ():
9+ """Test that batch naming occurs properly when batching prompts."""
10+ fs = RecordFs ({})
11+ repo = PromptRepository (fs = fs )
12+
13+ prompts = []
14+ for i in range (300 ):
15+ prompts .append (Prompt (f"prompt_{ i } .md" , f"Content for prompt { i } " ))
16+
17+ repo .batch (prompts )
18+
19+ expected_batch_1_prompts = 150
20+ expected_batch_2_prompts = 150
21+
22+ batch_1_count = 0
23+ batch_2_count = 0
24+ for prompt_id in repo .to_write :
25+ if prompt_id .startswith ("batch_1/" ):
26+ batch_1_count += 1
27+ elif prompt_id .startswith ("batch_2/" ):
28+ batch_2_count += 1
29+
30+ assert batch_1_count == expected_batch_1_prompts
31+ assert batch_2_count == expected_batch_2_prompts
You can’t perform that action at this time.
0 commit comments