aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/files/datacite/caseview.sh
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-01-02 17:35:54 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-01-02 17:35:54 +0100
commit96e38edde79735b4080ec08d57e9f54759e97b61 (patch)
tree2798719086819b747adab8d48adbb0c59b5ac9f5 /python/tests/files/datacite/caseview.sh
parentb87ba235c0a7da15d70c5ab7fa367d7b9c1fb981 (diff)
downloadfatcat-96e38edde79735b4080ec08d57e9f54759e97b61.tar.gz
fatcat-96e38edde79735b4080ec08d57e9f54759e97b61.zip
datacite: add conversion fixtures
The `test_datacite_conversions` function will compare an input (datacite) document to an expected output (release entity as JSON). This way, it should not be too hard to add more cases by adding: input, output - and by increasing the counter in the range loop within the test. To view input and result side by side with vim, change into the test directory and run: tests/files/datacite $ ./caseview.sh 18
Diffstat (limited to 'python/tests/files/datacite/caseview.sh')
-rwxr-xr-xpython/tests/files/datacite/caseview.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/python/tests/files/datacite/caseview.sh b/python/tests/files/datacite/caseview.sh
new file mode 100755
index 00000000..d1e98c04
--- /dev/null
+++ b/python/tests/files/datacite/caseview.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+# Open input and output in vertical vim split.
+#
+# $ caseview 13
+#
+view() {
+ if [ -z "$1" ]; then
+ echo usage: "$0" CASE-NUMBER
+ exit 1
+ else
+ padded=$(printf "%02d\n" "$1")
+ vim -O "datacite_doc_$padded.json" "datacite_result_$padded.json"
+ fi
+}
+
+view "$@"