Skip to content

Commit

Permalink
Merge pull request veraPDF#130 from georgetarazevich/StaticXmpCoreCon…
Browse files Browse the repository at this point in the history
…tainers-testing

Add new test: StaticXmpCoreContainers check
  • Loading branch information
MaximPlusov authored Dec 21, 2023
2 parents 24d8bee + 15b8138 commit ba6e01b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
32 changes: 32 additions & 0 deletions CLI/Metadata/StaticXmpCoreContainers/staticXmpCoreContainers.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bats
bats_require_minimum_version 1.5.0

setup() {
PROJECT_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../.." >/dev/null 2>&1 && pwd)"
load "$PROJECT_ROOT/tools/test_helper/common-setup.bash"
_common_setup

cp -r $BATS_TEST_DIRNAME/* $BATS_TEST_TMPDIR
}

teardown() {
echo -e "Done ... \n" >&3
}

@test 'StaticXmpCoreContainers check. XMPException: Unregistered schema namespace URI' {

run --separate-stderr -- verapdf/verapdf $BATS_TEST_TMPDIR/5-t01-fail-a.pdf $BATS_TEST_TMPDIR/5-t01-pass-a.pdf --fixmetadata --flavour ua1 --loglevel 4
[ "$status" -eq 1 ]
run echo $stderr
assert_output --partial "org.verapdf.xmp.XMPException: Unregistered schema namespace URI"
fineObtainPresent=$(echo $stderr | grep -w -o "FINE: Can not obtain identification fields" | wc -l) #Count the number of lines
assert_equal $fineObtainPresent "1"

run --separate-stderr -- verapdf/verapdf $BATS_TEST_TMPDIR/5-t01-fail-a.pdf --fixmetadata --flavour ua1 --loglevel 4
[ "$status" -eq 1 ]
run echo $stderr
assert_output --partial "org.verapdf.xmp.XMPException: Unregistered schema namespace URI"
fineObtainPresent=$(echo $stderr | grep -w -o "FINE: Can not obtain identification fields" | wc -l) #Count the number of lines
assert_equal $fineObtainPresent "1"

}

0 comments on commit ba6e01b

Please sign in to comment.