MCPcopy Create free account
hub / github.com/HzaCode/OneCite / test_manual_fallback

Method test_manual_fallback

tests/test_pipeline_unit.py:624–634  ·  view source on GitHub ↗

When both external providerRE and BASE return nothing we parse the text ourselves.

(self)

Source from the content-addressed store, hash-verified

622 assert t["authors"] == ["Smith, J."]
623
624 def test_manual_fallback(self):
625 """When both external providerRE and BASE return nothing we parse the text ourselves."""
626 ident = IdentifierModule()
627 with patch.object(ident, "_search_openaire_for_thesis", return_value=None), \
628 patch.object(ident, "_search_base_for_thesis", return_value=None):
629 t = ident._detect_thesis(
630 "Doe, J. (2020). Great Thesis. PhD thesis. Test University.")
631
632 assert t["source"] == "manual"
633 assert t["is_thesis"] is True
634 assert t["thesis_type"] == "phdthesis"
635
636
637# ===================================================================

Callers

nothing calls this directly

Calls 2

_detect_thesisMethod · 0.95
IdentifierModuleClass · 0.90

Tested by

no test coverage detected