orcli/tests/import-csv.sh

22 lines
389 B
Bash
Raw Permalink Normal View History

2022-11-30 23:49:54 +01:00
#!/bin/bash
2022-12-03 01:30:01 +01:00
t="import-csv"
2022-11-30 23:49:54 +01:00
2022-12-04 00:39:53 +01:00
# create tmp directory
2022-12-03 01:30:01 +01:00
tmpdir="$(mktemp -d)"
trap '{ rm -rf "${tmpdir}"; }' 0 2 3 15
2022-12-04 00:39:53 +01:00
# input
cp data/example.csv "${tmpdir}/${t}.csv"
# assertion
cp data/example.tsv "${tmpdir}/${t}.assert"
2022-11-30 23:49:54 +01:00
# action
2022-12-04 00:39:53 +01:00
cd "${tmpdir}" || exit 1
2023-01-12 11:18:06 +01:00
orcli import csv "${t}.csv" --projectName "${t}"
orcli export tsv "${t}" > "${t}.output"
2022-11-30 23:49:54 +01:00
# test
2022-12-03 01:30:01 +01:00
diff -u "${t}.assert" "${t}.output"