-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(findInCsv): add venom test for fieldsPerRecord all or pass limite
- Loading branch information
1 parent
95c5ebc
commit 841474c
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,7 @@ testcases: | |
exactMatch: | ||
csv: "{{.last_name}}+123" | ||
entry: "{{.nom}}+123" | ||
expected: "only-one" | ||
header: true | ||
separator: "%" | ||
comment: "#" | ||
|
@@ -81,3 +82,57 @@ testcases: | |
- result.code ShouldEqual 0 | ||
- result.systemout ShouldEqual {"nom":"Vidal","info_personne":{"first_name":"Luce","last_name":"Vidal","email":"[email protected]"}} | ||
- result.systemerr ShouldBeEmpty | ||
- name: find in CSV expect any number of fields | ||
steps: | ||
- script: rm -f masking.yml | ||
- script: |- | ||
cat > masking.yml <<EOF | ||
version: "1" | ||
seed: 1 | ||
masking: | ||
- selector: | ||
jsonpath: "info_personne" | ||
mask: | ||
findInCSV: | ||
uri: "file://../persons.csv" | ||
exactMatch: | ||
csv: "{{.last_name}}+123" | ||
entry: "{{.nom}}+123" | ||
expected: "only-one" | ||
header: true | ||
fieldsPerRecord: -1 | ||
EOF | ||
- script: |- | ||
echo '{"nom":"Vidal","info_personne":""}' | pimo | ||
assertions: | ||
- result.code ShouldEqual 0 | ||
- result.systemout ShouldEqual {"nom":"Vidal","info_personne":{"first_name":"Luce","last_name":"Vidal","email":"[email protected]"}} | ||
- result.systemerr ShouldBeEmpty | ||
- name: find in CSV expect exactly 4 fields and error | ||
steps: | ||
- script: rm -f masking.yml | ||
- script: |- | ||
cat > masking.yml <<EOF | ||
version: "1" | ||
seed: 1 | ||
masking: | ||
- selector: | ||
jsonpath: "info_personne" | ||
mask: | ||
findInCSV: | ||
uri: "file://../persons.csv" | ||
exactMatch: | ||
csv: "{{.last_name}}+123" | ||
entry: "{{.nom}}+123" | ||
expected: "only-one" | ||
header: true | ||
fieldsPerRecord: 4 | ||
EOF | ||
- script: |- | ||
echo '{"nom":"Vidal","info_personne":""}' | pimo | ||
assertions: | ||
- result.code ShouldNotEqual 0 | ||
- result.systemout ShouldBeEmpty | ||
- result.systemerr ShouldNotBeEmpty |