orcli/tests/info.sh

26 lines
403 B
Bash
Raw Permalink Normal View History

2022-12-04 00:39:53 +01:00
#!/bin/bash
t="info"
# create tmp directory
tmpdir="$(mktemp -d)"
trap '{ rm -rf "${tmpdir}"; }' 0 2 3 15
# input
cp data/example.csv "${tmpdir}/${t}.csv"
2022-12-06 17:21:11 +01:00
# assertion
cat << "DATA" > "${tmpdir}/${t}.assert"
a
b
c
DATA
2022-12-04 00:39:53 +01:00
# action
cd "${tmpdir}" || exit 1
2023-01-12 11:18:06 +01:00
orcli import csv "${t}.csv" --projectName "${t}"
orcli info "${t}" | jq -r .columns[] > "${t}.output"
2022-12-04 00:39:53 +01:00
# test
2022-12-06 17:21:11 +01:00
diff -u "${t}.assert" "${t}.output"