summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-01-02 18:52:53 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-01-02 18:52:53 +0100
commitb33782cabf60ec8b90338abd4986338683c30b72 (patch)
tree3ad87c3c4cd3465554c0cf102aa64ce4e6962c8a /python
parentbe43049db0da2df4343bd5e1392d6c5201fc67d0 (diff)
downloadfatcat-b33782cabf60ec8b90338abd4986338683c30b72.tar.gz
fatcat-b33782cabf60ec8b90338abd4986338683c30b72.zip
datacite: add helper script to create new test case
Diffstat (limited to 'python')
-rwxr-xr-xpython/tests/files/datacite/casecreate.sh14
1 files changed, 14 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..36ea08d2
--- /dev/null
+++ b/python/tests/files/datacite/casecreate.sh
@@ -0,0 +1,14 @@
+#!/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"