aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-04-04 11:59:28 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-04-04 11:59:28 -0700
commit8409128c47a287ccdf4d5092f094648495367e5a (patch)
tree7f38aef8146de6cd3d58972ac9d42198615b8a9a /python/tests
parent522e7dd363e60aa2c82d6ba222cdb7822045af3a (diff)
downloadfatcat-8409128c47a287ccdf4d5092f094648495367e5a.tar.gz
fatcat-8409128c47a287ccdf4d5092f094648495367e5a.zip
link to BibTeX (and test this)
Diffstat (limited to 'python/tests')
-rw-r--r--python/tests/web_citation_csl.py26
1 files changed, 26 insertions, 0 deletions
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')
+