Skip to content

Commit

Permalink
refactor: use common generator helpers for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellgartner committed Jan 28, 2025
1 parent 854e16e commit fd3a285
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 28 deletions.
2 changes: 1 addition & 1 deletion tests/test_scancode/generators/generate_scancode_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
SystemEnvironment,
Url,
)
from tests.test_scancode.generators.helpers import entry_or_none, random_list
from tests.util.generator_helpers import entry_or_none, random_list

type TempPathTree = dict[str, TempPathTree | None]

Expand Down
26 changes: 0 additions & 26 deletions tests/test_scancode/generators/helpers.py

This file was deleted.

3 changes: 2 additions & 1 deletion tests/util/generator_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def random_list[T](
faker: BaseProvider,
entry_generator: Callable[[], T],
max_number_of_entries: int = 3,
min_number_of_entries: int = 1,
) -> list[T]:
number_of_entries = faker.random_int(1, max_number_of_entries)
number_of_entries = faker.random_int(min_number_of_entries, max_number_of_entries)
return [entry_generator() for _ in range(number_of_entries)]

0 comments on commit fd3a285

Please sign in to comment.