From 8409128c47a287ccdf4d5092f094648495367e5a Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 4 Apr 2019 11:59:28 -0700 Subject: link to BibTeX (and test this) --- python/tests/web_citation_csl.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 python/tests/web_citation_csl.py (limited to 'python/tests/web_citation_csl.py') diff --git a/python/tests/web_citation_csl.py b/python/tests/web_citation_csl.py new file mode 100644 index 00000000..1b6f34e1 --- /dev/null +++ b/python/tests/web_citation_csl.py @@ -0,0 +1,26 @@ + + +import json +import tempfile +import pytest +from fatcat_client.rest import ApiException +from fixtures import * + + +def test_release_bibtex(app): + + # "realistic" demo entity + rv = app.get('/release/aaaaaaaaaaaaarceaaaaaaaaam') + assert rv.status_code == 200 + assert b'BibTeX' in rv.data + rv = app.get('/release/aaaaaaaaaaaaarceaaaaaaaaam.bib') + assert rv.status_code == 200 + assert b'@article{' in rv.data + + # "dummy" demo entity + rv = app.get('/release/aaaaaaaaaaaaarceaaaaaaaaai') + assert rv.status_code == 200 + assert not b'BibTeX' in rv.data + with pytest.raises(ValueError): + rv = app.get('/release/aaaaaaaaaaaaarceaaaaaaaaai.bib') + -- cgit v1.2.3