Skip to content

Commit

Permalink
Update tests: type & features
Browse files Browse the repository at this point in the history
  • Loading branch information
georgetarazevich committed Dec 12, 2023
1 parent 7b48a53 commit 7ba8b7c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 27 deletions.
17 changes: 12 additions & 5 deletions tests/Options/config/app/type.bats
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,27 @@ setup() {

docker cp $BATS_TEST_DIRNAME/type/app.xml $DOCKER_CONTAINER:/opt/verapdf-rest/config/app.xml
docker cp $BATS_TEST_DIRNAME/type/features.xml $DOCKER_CONTAINER:/opt/verapdf-rest/config/features.xml
docker cp $BATS_TEST_DIRNAME/type/validator.xml $DOCKER_CONTAINER:/opt/verapdf-rest/config/validator.xml

}

teardown() {
docker cp $DOCKER_CONTAINER:/opt/verapdf-rest/config/app.xml $BATS_TEST_TMPDIR
cat $BATS_TEST_TMPDIR/app.xml >&3
docker cp $DOCKER_CONTAINER:/opt/verapdf-rest/config/validator.xml $BATS_TEST_TMPDIR
docker cp $DOCKER_CONTAINER:/opt/verapdf-rest/config/features.xml $BATS_TEST_TMPDIR

cat $BATS_TEST_TMPDIR/app.xml >&3
cat $BATS_TEST_TMPDIR/validator.xml >&3
cat $BATS_TEST_TMPDIR/features.xml >&3

echo -e "Done ..." >&3
}

@test "--type, The default processing model for the GUI, type=VALIDATE_EXTRACT" {

run curl -F "file=@$PROJECT_ROOT/Resources/Mustang_505.pdf" localhost:8080/api/validate/1b -H "Accept:text/html"
assert_output --partial "ICC profiles"

[ "$status" -eq 0 ]
run curl -F "file=@$PROJECT_ROOT/Resources/5-t02-fail-a.pdf" localhost:8080/api/validate/1b -H "Accept:text/html"
assert_output --partial "Information dictionary"
assert_output --partial "<td>PDF/A-2U validation profile</td>"

[ "$status" -eq 10 ]
}
21 changes: 0 additions & 21 deletions tests/Options/config/app/type/features.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<featuresConfig>
<enabledFeatures>
<feature>ACTION</feature>
<feature>ANNOTATION</feature>
<feature>COLORSPACE</feature>
<feature>DOCUMENT_SECURITY</feature>
<feature>EMBEDDED_FILE</feature>
<feature>EXT_G_STATE</feature>
<feature>FONT</feature>
<feature>FORM_XOBJECT</feature>
<feature>ICCPROFILE</feature>
<feature>IMAGE_XOBJECT</feature>
<feature>INFORMATION_DICTIONARY</feature>
<feature>INTERACTIVE_FORM_FIELDS</feature>
<feature>LOW_LEVEL_INFO</feature>
<feature>METADATA</feature>
<feature>OUTLINES</feature>
<feature>OUTPUTINTENT</feature>
<feature>PAGE</feature>
<feature>PATTERN</feature>
<feature>POSTSCRIPT_XOBJECT</feature>
<feature>PROPERTIES</feature>
<feature>SHADING</feature>
<feature>SIGNATURE</feature>
</enabledFeatures>
</featuresConfig>
2 changes: 2 additions & 0 deletions tests/Options/config/app/type/validator.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<validatorConfig recordPasses="false" maxFails="1" debug="true" showErrorMessages="false" isLogsEnabled="false" loggingLevel="WARNING" maxNumberOfDisplayedFailedChecks="3" showProgress="false" defaultFlavour="PDFA_1_B" flavour="PDFUA_2"/>
2 changes: 1 addition & 1 deletion tests/Options/config/features/features/app.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<appConfig type="VALIDATE_EXTRACT" format="XML" isVerbose="false">
<appConfig type="EXTRACT" format="XML" isVerbose="false">
<fixerFolder></fixerFolder>
<wikiPath>https://github.com/veraPDF/veraPDF-validation-profiles/wiki/</wikiPath>
<policyFile></policyFile>
Expand Down
Binary file added tests/Resources/5-t02-fail-a.pdf
Binary file not shown.

0 comments on commit 7ba8b7c

Please sign in to comment.