Skip to content

Commit

Permalink
ruff formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
briehl committed Dec 9, 2024
1 parent a4e3949 commit b3613ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions staging_service/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ def _file_type_resolver(path: PathPy) -> FileTypeResolution:

def _make_dts_file_resolver() -> Callable[[Path], FileTypeResolution]:
"""Makes a DTS file resolver."""

def dts_file_resolver(path: PathPy):
# must be a ".json" file
file_parts = str(path).split(".")
ext = file_parts[-1]
if len(file_parts) < 2 or ext.lower() != "json":
return FileTypeResolution(unsupported_type=ext)
return FileTypeResolution(parser=parse_dts_manifest)

return dts_file_resolver


Expand Down
4 changes: 3 additions & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,9 @@ async def test_bulk_specification_dts_success():
json.dump(manifest_1_dict, f)
with open(base / manifest_2, "w", encoding="utf-8") as f:
json.dump(manifest_2_dict, f)
resp = await cli.get(f"bulk_specification/?files={sub_dir}/{manifest_1} , {sub_dir}/{manifest_2}&dts")
resp = await cli.get(
f"bulk_specification/?files={sub_dir}/{manifest_1} , {sub_dir}/{manifest_2}&dts"
)
jsn = await resp.json()
# fails for now. will update when schema/parser is properly finished.
assert jsn == {
Expand Down

0 comments on commit b3613ea

Please sign in to comment.