def test_thing_deepen_search(): """Thing - find_more_about(): Should pass""" endpoints = [ Endpoint.dbpedia_fr, Endpoint.dbpedia, Endpoint.wikidata, Endpoint.bnf ] thing = Thing(url='http://dbpedia.org/resource/Charles_Baudelaire') thing.add_query_endpoints(endpoints) thing.query(strict_mode=True) attr_before_deep_search = len(thing.attributes) thing.find_more_about() attr_after_deep_search = len(thing.attributes) assert attr_before_deep_search < attr_after_deep_search
def test_thing_query_URLs(): """Thing - URLs list query - : Should pass """ thing = Thing(url=[ 'http://viaf.org/viaf/17218730', 'http://www.wikidata.org/entity/Q501', 'http://dbpedia.org/resource/Charles_Baudelaire' ]) thing.add_query_endpoints([e for e in Endpoint]) thing.query(strict_mode=True) assert u'http://dbpedia.org/resource/Charles_Baudelaire' in thing.attributes.get( u'owl:sameAs')
def test_thing_add_query_endpoints(): """Thing - add_query_endpoints: Should pass""" thing = Thing() all_endpoints = set([e for e in Endpoint if not e == Endpoint.DEFAULT]) thing.add_query_endpoints(all_endpoints) assert thing.endpoints == all_endpoints