Skip to content
Snippets Groups Projects
Commit fed77217 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: reduce code duplication

parent 57d29b51
No related branches found
No related tags found
2 merge requests!91Release 0.3,!88MAINT: convert the Validation exception to debug output in crawler_main
Pipeline #33012 passed
...@@ -769,8 +769,9 @@ def test_validation_error_print(capsys): ...@@ -769,8 +769,9 @@ def test_validation_error_print(capsys):
# there should be no server interaction since we only test the behavior if a validation error # there should be no server interaction since we only test the behavior if a validation error
# occurs during the data collection stage # occurs during the data collection stage
DATADIR = os.path.join(os.path.dirname(__file__), "test_data", "failing_validation") DATADIR = os.path.join(os.path.dirname(__file__), "test_data", "failing_validation")
for fi in ["cfood.yml", "cfood2.yml"]:
ret = crawler_main(DATADIR, ret = crawler_main(DATADIR,
os.path.join(DATADIR, "cfood.yml"), os.path.join(DATADIR, fi),
os.path.join(DATADIR, "identifiables.yml"), os.path.join(DATADIR, "identifiables.yml"),
True, True,
None, None,
...@@ -780,21 +781,6 @@ def test_validation_error_print(capsys): ...@@ -780,21 +781,6 @@ def test_validation_error_print(capsys):
assert "Couldn't validate" in captured.out assert "Couldn't validate" in captured.out
def test_validation_error_print_dict(capsys):
# there should be no server interaction since we only test the behavior if a validation error
# occurs during the data collection stage
DATADIR = os.path.join(os.path.dirname(__file__), "test_data", "failing_validation")
ret = crawler_main(DATADIR,
os.path.join(DATADIR, "cfood2.yml"),
os.path.join(DATADIR, "identifiables.yml"),
True,
None,
False,
"/use_case_simple_presentation")
# captured = capsys.readouterr()
# assert "Couldn't validate" in captured.out
def test_split_into_inserts_and_updates_backref(crawler_mocked_for_backref_test): def test_split_into_inserts_and_updates_backref(crawler_mocked_for_backref_test):
crawler = crawler_mocked_for_backref_test crawler = crawler_mocked_for_backref_test
identlist = [Identifiable(name="A", record_type="BR"), identlist = [Identifiable(name="A", record_type="BR"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment