Skip to content

Commit 9f8c2f7

Browse files
committed
Fix #2652 query server URL read from configuration
1 parent 3749a6d commit 9f8c2f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_ask_query.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import re
44
import requests
55

6+
from scholia.config import config
7+
68
USER_AGENT = "Scholia"
79
HEADERS = {"User-Agent": USER_AGENT}
810

@@ -44,7 +46,7 @@ def ask_query(file_name, q_number):
4446

4547
query = re.sub(r"\{\{ ?q ?\}\}", q_number, query)
4648

47-
url = "https://query.wikidata.org/sparql"
49+
url = config['query-server']['sparql_endpoint']
4850
params = {"query": query, "format": "json"}
4951
response = requests.get(url, params=params, headers=HEADERS)
5052

0 commit comments

Comments
 (0)