def test_local_fundref_convert(app): """Test the XML to JSON conversion of local FundRef dataset.""" # Test the keys and dict structure for test dataset app.config.update(OPENAIRE_FUNDREF_LOCAL_SOURCE=os.path.join( os.path.dirname(__file__), 'testdata/fundref_test.rdf') ) frl = LocalFundRefLoader() d = {ds['doi']: ds for ds in frl.iter_funders()} assert d['10.13039/001']['name'] == 'University of Foo' assert len(d['10.13039/001']['acronyms']) == 2 assert 'UoF' in d['10.13039/001']['acronyms'] assert 'UOF' in d['10.13039/001']['acronyms'] assert d['10.13039/001']['country'] == 'US' assert d['10.13039/002']['name'] == 'Department of Bar' assert len(d['10.13039/002']['acronyms']) == 1 assert 'DoB' in d['10.13039/002']['acronyms'] assert d['10.13039/002']['country'] == 'US' assert d['10.13039/003']['name'] == 'Department of Eggs' assert len(d['10.13039/003']['acronyms']) == 0 assert d['10.13039/003']['country'] == 'US' assert d['10.13039/004']['name'] == 'Faculty of Spam' assert len(d['10.13039/004']['acronyms']) == 1 assert 'FoS' in d['10.13039/004']['acronyms'] assert d['10.13039/004']['country'] == 'US' assert d['10.13039/501100000923']['name'] == 'University of Bacon' assert len(d['10.13039/501100000923']['acronyms']) == 1 assert 'UoB' in d['10.13039/501100000923']['acronyms'] assert d['10.13039/501100000923']['country'] == 'CH' assert not d['10.13039/001']['parent'] assert d['10.13039/002']['parent'] assert {'$ref': 'http://dx.doi.org/10.13039/001'} == \ d['10.13039/002']['parent'] assert d['10.13039/003']['parent'] assert {'$ref': 'http://dx.doi.org/10.13039/001'} == \ d['10.13039/003']['parent'] assert d['10.13039/004']['parent'] assert {'$ref': 'http://dx.doi.org/10.13039/002'} == \ d['10.13039/004']['parent'] assert not d['10.13039/501100000923']['parent']
def test_local_fundref_loader(app): """Test the loadef for the FundRef dataset.""" # Test loading the real FundRef dataset. frl = LocalFundRefLoader() json_dataset = list(frl.iter_funders()) assert len(json_dataset) == 11565 # Current FundRef dataset size
def test_local_fundref_loader(app): """Test the loadef for the FundRef dataset.""" # Test loading the real FundRef dataset. frl = LocalFundRefLoader() json_dataset = list(frl.iter_funders()) assert len(json_dataset) == 18067 # Current FundRef dataset size