From 9aeb154a32849649ac3722c52106d9abd8ec5c07 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 22 May 2019 14:35:56 -0700 Subject: count linked refs (not just raw refs) in elasticsearch --- python/tests/transform_tests.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'python/tests') diff --git a/python/tests/transform_tests.py b/python/tests/transform_tests.py index 27f54d92..c36137ba 100644 --- a/python/tests/transform_tests.py +++ b/python/tests/transform_tests.py @@ -22,6 +22,10 @@ def test_rich_elasticsearch_convert(crossref_importer): release_year=1234, license_slug="CC-BY-NC", ext_ids=ReleaseExtIds(), + refs=[ + ReleaseRef(), + ReleaseRef(target_release_id="iznnn644szdwva7khyxqzc73bi"), + ], ) r.state = 'active' r.container = ContainerEntity( @@ -65,6 +69,8 @@ def test_rich_elasticsearch_convert(crossref_importer): assert es['in_dweb'] == True assert es['is_oa'] == True assert es['is_longtail_oa'] == False + assert es['ref_count'] == 2 + assert es['ref_linked_count'] == 1 def test_elasticsearch_from_json(): r = entity_from_json(open('./tests/files/math_universe.json', 'r').read(), ReleaseEntity) -- cgit v1.2.3