-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_researchsquare.py
More file actions
25 lines (19 loc) · 853 Bytes
/
Copy pathtest_researchsquare.py
File metadata and controls
25 lines (19 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from harvest import collect_paper_data_from_researchsquare
def test_collect_paper_data_from_researchsquare_pdf_url():
url = "https://www.researchsquare.com/article/rs-7745381/latest.pdf"
data = collect_paper_data_from_researchsquare(url)
assert data is not None
assert data["title"]
assert data["authors"]
print("title:", data["title"])
print("authors:", data["authors"])
print("year:", data.get("year"))
def test_collect_paper_data_from_researchsquare_article_url():
url = "https://www.researchsquare.com/article/rs-7745381"
data = collect_paper_data_from_researchsquare(url)
assert data is not None
assert data["title"]
if __name__ == "__main__":
test_collect_paper_data_from_researchsquare_pdf_url()
test_collect_paper_data_from_researchsquare_article_url()
print("all tests passed")