Skip to content

Commit

Permalink
Fix typing and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jgreben committed May 10, 2024
1 parent 87deb4f commit 1a231f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from flask import flash, request
from flask_appbuilder import expose, BaseView as AppBuilderBaseView
from typing import Union

from libsys_airflow.plugins.data_exports.instance_ids import save_ids

Expand All @@ -14,7 +15,7 @@
vendors = json.load(vendor_file)


def upload_data_export_ids(ids_df: pd.DataFrame, vendor: str, kind: str) -> str:
def upload_data_export_ids(ids_df: pd.DataFrame, vendor: str, kind: str) -> Union[str, None]:
if len(ids_df.columns) > 1:
raise ValueError("ID file has more than one column.")
tuples = list(ids_df.itertuples(index=False, name=None))
Expand Down
7 changes: 4 additions & 3 deletions tests/data_exports/test_marc_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,12 @@ def test_retrieve_marc_for_instance_404(mocker, mock_folio_404, tmp_path, caplog
assert "response code 404" in caplog.text


def test_fetch_marc_missing_instance_file(tmp_path):
def test_fetch_marc_missing_instance_file(tmp_path, caplog):
setup_test_file_updates(tmp_path)

with pytest.raises(ValueError, match="Vendor instance files do not exist"):
instance_files_dir(airflow=tmp_path, vendor="gobi")
instance_files_dir(airflow=tmp_path, vendor="gobi")

assert "Vendor instance files do not exist" in caplog.text


def test_marc_for_instances(mocker, tmp_path, mock_folio_client):
Expand Down

0 comments on commit 1a231f6

Please sign in to comment.