Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Alan Konarski <[email protected]>
  • Loading branch information
ludwiktrammer and akonarski-ds authored Oct 17, 2024
1 parent f7f79a9 commit cfd96f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ def list_sources(cls, path: Path, file_pattern: str = "*") -> list["LocalFileSou
Returns:
List of source objects.
"""
sources = []
for file_path in path.glob(file_pattern):
sources.append(cls(path=file_path))
return sources
return [cls(path=file_path) for file_path in path.glob(file_pattern)]


class GCSSource(Source):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ async def test_local_source_fetch():
source = LocalFileSource(path=TEST_FILE_PATH)

path = await source.fetch()

assert path == TEST_FILE_PATH


async def test_local_source_list_sources():
example_files = TEST_FILE_PATH.parent / "example_files"

sources = LocalFileSource.list_sources(example_files, file_pattern="*.md")

assert len(sources) == 2
Expand Down

0 comments on commit cfd96f6

Please sign in to comment.