summaryrefslogtreecommitdiffstats
path: root/python/tests/transform_csl.py
diff options
context:
space:
mode:
authorbnewbold <bnewbold@archive.org>2020-03-26 22:35:28 +0000
committerbnewbold <bnewbold@archive.org>2020-03-26 22:35:28 +0000
commitea241c0718407285774bff85e4b3b99aed0b9186 (patch)
treef28b9730adc570347ad48b17bb0482d1c9ced3c8 /python/tests/transform_csl.py
parentec82404f0d0ad6b92491a1cb90a823d421857348 (diff)
parentec15f162706da58c464b5c2b7b623920fcb96d7f (diff)
downloadfatcat-ea241c0718407285774bff85e4b3b99aed0b9186.tar.gz
fatcat-ea241c0718407285774bff85e4b3b99aed0b9186.zip
Merge branch 'bnewbold-citeproc-fixes' into 'master'
improve citeproc/CSL web interface See merge request webgroup/fatcat!36
Diffstat (limited to 'python/tests/transform_csl.py')
-rw-r--r--python/tests/transform_csl.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/python/tests/transform_csl.py b/python/tests/transform_csl.py
index 6f29cba7..15c64ce5 100644
--- a/python/tests/transform_csl.py
+++ b/python/tests/transform_csl.py
@@ -12,22 +12,22 @@ def test_csl_crossref(crossref_importer):
# not a single line
raw = json.loads(f.read())
r = crossref_importer.parse_record(raw)
- # this work has some null contrib names; these should cause errors
- with pytest.raises(ValueError):
- release_to_csl(r)
- with pytest.raises(ValueError):
- csl = release_to_csl(r)
- citeproc_csl(csl, 'csl-json')
- # set with dummy so we can run other tests
- for c in r.contribs:
- if not c.raw_name:
- c.raw_name = "dummy"
csl = release_to_csl(r)
citeproc_csl(csl, 'csl-json')
citeproc_csl(csl, 'bibtex')
citeproc_csl(csl, 'harvard1')
citeproc_csl(csl, 'harvard1', html=True)
+ # check that with no author surnames, can't run
+ for c in r.contribs:
+ c.raw_name = None
+ c.surname = None
+ with pytest.raises(ValueError):
+ release_to_csl(r)
+ with pytest.raises(ValueError):
+ csl = release_to_csl(r)
+ citeproc_csl(csl, 'csl-json')
+
def test_csl_pubmed(crossref_importer):
with open('tests/files/example_releases_pubmed19n0972.json', 'r') as f:
# multiple single lines