[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[robocop] 12/37: Add new tests
From: |
Admin |
Subject: |
[robocop] 12/37: Add new tests |
Date: |
Thu, 05 Jun 2025 10:20:57 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository robocop.
commit 9a202c5af7bdd5a1d7552bb17749f6cf68bdfec2
Author: Gust Leenaars <gl.nlnet@leenaa.rs>
AuthorDate: Wed May 7 11:31:12 2025 +0200
Add new tests
---
test/Tests/Check.hs | 27 ++++++----
test/Tests/Targets/Real.hs | 126 +++++++++++++++++++++++++++++++++++++++++++++
test/data/target_57355.xml | 33 ++++++++++++
3 files changed, 177 insertions(+), 9 deletions(-)
diff --git a/test/Tests/Check.hs b/test/Tests/Check.hs
index 108286e..a4abcec 100644
--- a/test/Tests/Check.hs
+++ b/test/Tests/Check.hs
@@ -159,18 +159,27 @@ personTests sanction_list =
{- testTargetVersions False SSID sanction_list $
, (target_SSID_vN, " vN", distribution ADDRESS DATE ID NAME
NATIONALITY CONFIDENCE -}
, testTargetVersions False 49816 sanction_list $
- [ (target_49816_v1, " v1", distribution 0 100 0 125 0
0.75)
- , (target_49816_v2, " v2", distribution 0 100 0 0 0
0 )
- , (target_49816_v3, " v3", distribution 0 0 0 0 0
0 )
- , (target_49816_v4, " v4", distribution 0 100 0 125 0
0.75)
+ [ (target_49816_v1, " v1", distribution 0 100 0 125 0
0.75) -- Name and date
+ , (target_49816_v2, " v2", distribution 0 100 0 0 0
0 ) -- First name and date
+ , (target_49816_v3, " v3", distribution 0 0 0 0 0
0 ) -- Nothing
+ , (target_49816_v4, " v4", distribution 0 100 0 125 0
0.75) -- Name
]
, testTargetVersions False 38925 sanction_list $
- [ (target_38925_v1, " v1", distribution 100 0 0 0 0 0.75) --
Only address
- , (target_38925_v2, " v2", distribution 0 0 0 125 0 0 ) --
Only name
- , (target_38925_v3, " v3", distribution 0 100 0 0 0 0 ) --
Only birthdate
- , (target_38925_v4, " v4", distribution 100 0 0 0 0 0.75) --
Only address
- , (target_38925_v5, " v5", distribution 100 100 0 0 0 0.75) --
Address + birthdate
+ [ (target_38925_v1, " v1", distribution 100 0 0 0 0
0.75) -- Only address
+ , (target_38925_v2, " v2", distribution 0 0 0 125 0
0 ) -- Only name
+ , (target_38925_v3, " v3", distribution 0 100 0 0 0
0 ) -- Only birthdate
+ , (target_38925_v4, " v4", distribution 100 0 0 0 0
0.75) -- Only address
+ , (target_38925_v5, " v5", distribution 100 100 0 0 0
0.75) -- Address + birthdate
+ ]
+
+ , testTargetVersions False 57355 sanction_list $
+ [ (target_57355_v1, " v1", distribution 100 100 0 125 0
0.75) -- Name, date and address
+ , (target_57355_v2, " v2", distribution 100 100 0 125 0
0.75) -- Alias, date and address
+ , (target_57355_v3, " v3", distribution 100 0 0 125 0
0.75) -- Name, address
+ , (target_57355_v4, " v4", distribution 0 0 0 125 0
0.75) -- Name with spelling mistake
+ , (target_57355_v5, " v5", distribution 0 100 0 125 0
0.75) -- Name with spelling mistake and date
+ , (target_57355_v5, " v6", distribution 0 0 0 125 0
0) -- Name
]
]
diff --git a/test/Tests/Targets/Real.hs b/test/Tests/Targets/Real.hs
index eaf97d1..af42e0c 100644
--- a/test/Tests/Targets/Real.hs
+++ b/test/Tests/Targets/Real.hs
@@ -20,6 +20,12 @@ module Tests.Targets.Real
, target_38925_v4
, target_38925_v5
, target_68815
+ , target_57355_v1
+ , target_57355_v2
+ , target_57355_v3
+ , target_57355_v4
+ , target_57355_v5
+ , target_57355_v6
) where
import Data.CountryCodes
@@ -425,3 +431,123 @@ target_68815 = NaturalPerson
, country_subdivision = Nothing
}
}
+
+target_57355_v1 :: NaturalPerson
+target_57355_v1 = NaturalPerson
+ { full_name = "Jimmy Cherizier"
+ , last_name = "Cherizier"
+ , birthdate = YearMonthDay 1977 03 30
+ , nationality = HT
+ , national_id = "012345ABCDEF"
+ , residential = GLS.Address { GLS.country = HT
+ , street_name = "Impasse Manius"
+ , street_number = "16"
+ , GLS.lines = Nothing
+ , building_name = Nothing
+ , building_number = Just "40B"
+ , zipcode = "Non existent"
+ , town_location = Just "Delmas"
+ , town_district = Nothing
+ , country_subdivision = Just "Port-au-Prince"
+ }
+ }
+
+target_57355_v2 :: NaturalPerson
+target_57355_v2 = NaturalPerson
+ { full_name = "Jimmy Barbeque"
+ , last_name = "Barbeque"
+ , birthdate = YearMonthDay 1977 03 30
+ , nationality = HT
+ , national_id = "012345ABCDEF"
+ , residential = GLS.Address { GLS.country = HT
+ , street_name = "Impasse Manius"
+ , street_number = "16"
+ , GLS.lines = Nothing
+ , building_name = Nothing
+ , building_number = Just "40B"
+ , zipcode = "Non existent"
+ , town_location = Just "Delmas"
+ , town_district = Nothing
+ , country_subdivision = Just "Port-au-Prince"
+ }
+ }
+
+target_57355_v3 :: NaturalPerson
+target_57355_v3 = NaturalPerson
+ { full_name = "Jim Cherizier"
+ , last_name = "Cherizier"
+ , birthdate = YearMonthDay 1953 02 19
+ , nationality = HT
+ , national_id = "012345ABCDEF"
+ , residential = GLS.Address { GLS.country = HT
+ , street_name = "Impasse Manius"
+ , street_number = "16"
+ , GLS.lines = Nothing
+ , building_name = Nothing
+ , building_number = Just "40B"
+ , zipcode = "Non existent"
+ , town_location = Just "Delmas"
+ , town_district = Nothing
+ , country_subdivision = Just "Port-au-Prince"
+ }
+ }
+
+target_57355_v4 :: NaturalPerson
+target_57355_v4 = NaturalPerson
+ { full_name = "Jimmy Cherisier"
+ , last_name = "Cherisier"
+ , birthdate = YearMonthDay 1953 02 19
+ , nationality = HT
+ , national_id = "012345ABCDEF"
+ , residential = GLS.Address { GLS.country = HT
+ , street_name = "Non existent"
+ , street_number = "Non existent"
+ , GLS.lines = Nothing
+ , building_name = Nothing
+ , building_number = Nothing
+ , zipcode = "Non existent"
+ , town_location = Nothing
+ , town_district = Nothing
+ , country_subdivision = Nothing
+ }
+ }
+
+target_57355_v5 :: NaturalPerson
+target_57355_v5 = NaturalPerson
+ { full_name = "Jimmy Cherisier"
+ , last_name = "Cherisier"
+ , birthdate = YearMonthDay 1977 03 30
+ , nationality = HT
+ , national_id = "012345ABCDEF"
+ , residential = GLS.Address { GLS.country = HT
+ , street_name = "Non existent"
+ , street_number = "Non existent"
+ , GLS.lines = Nothing
+ , building_name = Nothing
+ , building_number = Nothing
+ , zipcode = "Non existent"
+ , town_location = Nothing
+ , town_district = Nothing
+ , country_subdivision = Nothing
+ }
+ }
+
+target_57355_v6 :: NaturalPerson
+target_57355_v6 = NaturalPerson
+ { full_name = "Jim Cherizier"
+ , last_name = "Cherizier"
+ , birthdate = YearMonthDay 1953 02 19
+ , nationality = HT
+ , national_id = "012345ABCDEF"
+ , residential = GLS.Address { GLS.country = HT
+ , street_name = "Non existent"
+ , street_number = "Non existent"
+ , GLS.lines = Nothing
+ , building_name = Nothing
+ , building_number = Nothing
+ , zipcode = "Non existent"
+ , town_location = Nothing
+ , town_district = Nothing
+ , country_subdivision = Nothing
+ }
+ }
diff --git a/test/data/target_57355.xml b/test/data/target_57355.xml
new file mode 100644
index 0000000..b8dc9ec
--- /dev/null
+++ b/test/data/target_57355.xml
@@ -0,0 +1,33 @@
+<swiss-sanctions-list list-type="whole-list" date="2024-07-30">
+ <target ssid="57351">
+ <sanctions-set-id>4387</sanctions-set-id>
+ <individual>
+ <identity ssid="57355" main="true">
+ <name ssid="57356" name-type="primary-name"
quality="good" lang="eng">
+ <name-part order="1"
name-part-type="family-name">
+ <value>Cherizier</value>
+ </name-part>
+ <name-part order="2"
name-part-type="given-name">
+ <value>Jimmy</value>
+ </name-part>
+ </name>
+ <name ssid="57357" name-type="alias"
quality="low" lang="eng">
+ <name-part order="1"
name-part-type="whole-name">
+ <value>Barbeque</value>
+ </name-part>
+ </name>
+ <nationality ssid="66666">
+ <country iso-code="HT">Haiti</country>
+ </nationality>
+ <day-month-year ssid="66664" day="30" month="3"
year="1977" calendar="Gregorian" quality="good"/>
+ <place-of-birth ssid="66665" place-id="66660"
quality="good"/>
+ <address ssid="66663" place-id="66660"
quality="good">
+ <address-details>16, Imp Manius, Delmas
40 B</address-details>
+ </address>
+ </identity>
+ <justification ssid="57352">Jimmy Cherizier (AKA
“Barbeque”) has engaged in acts that threaten the peace, security, and
stability of Haiti and has planned, directed, or committed acts that constitute
serious human rights abuses. Jimmy Cherizier is one of Haiti’s most influential
gang leaders and leads an alliance of Haitian gangs known as the "G9 Family and
Allies."</justification>
+ <other-information ssid="66661">Designation: Former
Police Officer</other-information>
+ <other-information ssid="66662">National identification
no: 001-843-989-7 (NIF – Haiti)</other-information>
+ </individual>
+ </target>
+</swiss-sanctions-list>
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [robocop] 03/37: Improve testsuite, (continued)
- [robocop] 03/37: Improve testsuite, Admin, 2025/06/05
- [robocop] 06/37: Add more tests, Admin, 2025/06/05
- [robocop] 05/37: Add tests, Admin, 2025/06/05
- [robocop] 02/37: Initialise repository, Admin, 2025/06/05
- [robocop] 04/37: More tests, update config & licenses, Admin, 2025/06/05
- [robocop] 01/37: init w/ instruction files, Admin, 2025/06/05
- [robocop] 10/37: Update testfunctions, Admin, 2025/06/05
- [robocop] 09/37: Improve address matching, Admin, 2025/06/05
- [robocop] 11/37: Re-order tests, Admin, 2025/06/05
- [robocop] 08/37: Add more tests, Admin, 2025/06/05
- [robocop] 12/37: Add new tests,
Admin <=
- [robocop] 07/37: Improve checks + tests, Admin, 2025/06/05