summaryrefslogtreecommitdiffstats
path: root/python/tests/files/datacite/casecreate.sh
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-01-08 23:31:40 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-01-08 23:31:40 +0100
commit081746837a55bf5f34c96f12f1abb5a00d5b478c (patch)
tree88af1ade558ad6695918d36648b3ed4a5bea6954 /python/tests/files/datacite/casecreate.sh
parent27723a61bde5591bae8115d801d0d09b7ef01b03 (diff)
parent277bd183d7139bb1a8857bc2a48c0aa92012455d (diff)
downloadfatcat-081746837a55bf5f34c96f12f1abb5a00d5b478c.tar.gz
fatcat-081746837a55bf5f34c96f12f1abb5a00d5b478c.zip
Merge branch 'martin-datacite-import'
Pipfile.lock is broken. * martin-datacite-import: (68 commits) datacite: pass in doi into factored out method datacite: reformat test cases and use jq . --sort-keys datacite: factor out contributor handling datacite: catch type mismatch in language detection datacite: adjust tests for release_month datacite: name extra.month, extra.release_month datacite: mark additional files as stub datacite: CCDC are entries, mostly datacite: use more specific release_type, if possible datacite: ignore certain names datacite: over 3% records have the same title: stub datacite: fill a few more release_type gaps datacite: adding datacite-specific extra metadata datacite: apply pylint suggestions datacite: fix typos datacite: set release_stage to published by default datacite: month field should be top-level datacite: include month in extra datacite: indicate mismatched file in test datacite: clean abstracts, use unknown value tokens ...
Diffstat (limited to 'python/tests/files/datacite/casecreate.sh')
-rwxr-xr-xpython/tests/files/datacite/casecreate.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/python/tests/files/datacite/casecreate.sh b/python/tests/files/datacite/casecreate.sh
new file mode 100755
index 00000000..82655dc3
--- /dev/null
+++ b/python/tests/files/datacite/casecreate.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+#
+# casecreate.sh creates a new test case file pair by copying the last one.
+#
+set -eo pipefail
+
+max=$(find . -name 'datacite_doc_*' | sort -n | tail -1 | grep -Eo '[0-9]+')
+if [ -z $max ]; then
+ echo "failed, expected datacite_doc_[NUMBER]..."
+ exit 1
+fi
+new=$((max+1))
+cp "datacite_doc_$max.json" "datacite_doc_$new.json"
+cp "datacite_result_$max.json" "datacite_result_$new.json"
+
+[ -f ./caseview.sh ] && ./caseview.sh "$new"