Skip to content

Commit

Permalink
feat(findInCsv): add venom test for fieldsPerRecord all or pass limite
Browse files Browse the repository at this point in the history
  • Loading branch information
Chao-Ma5566 committed Nov 28, 2023
1 parent 95c5ebc commit 841474c
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions test/suites/masking_find_in_csv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ testcases:
exactMatch:
csv: "{{.last_name}}+123"
entry: "{{.nom}}+123"
expected: "only-one"
header: true
separator: "%"
comment: "#"
Expand All @@ -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

0 comments on commit 841474c

Please sign in to comment.