From f788c350b4229c3fa5901dd3368dd7584e98d7fd Mon Sep 17 00:00:00 2001 From: turnerm Date: Wed, 25 Oct 2023 23:55:59 +0200 Subject: [PATCH] HAPI-133 fix tests --- ...hocn96-0-export-format-csv-gid-797752596.csv | 16 ++++++++++++++++ ...ubilgc4-export-format-csv-gid-2037574879.csv | 17 +++++++++++++++++ tests/test_main.py | 4 ++-- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 tests/fixtures/input/food_security_ch_12nkxos71u6lkttpyytfwi2bdq9yen1j7jplhocn96-0-export-format-csv-gid-797752596.csv create mode 100644 tests/fixtures/input/food_security_ch_1sxsircxhxmzce0pwafcht-whjbdi9uqoefesubilgc4-export-format-csv-gid-2037574879.csv diff --git a/tests/fixtures/input/food_security_ch_12nkxos71u6lkttpyytfwi2bdq9yen1j7jplhocn96-0-export-format-csv-gid-797752596.csv b/tests/fixtures/input/food_security_ch_12nkxos71u6lkttpyytfwi2bdq9yen1j7jplhocn96-0-export-format-csv-gid-797752596.csv new file mode 100644 index 00000000..63a2044b --- /dev/null +++ b/tests/fixtures/input/food_security_ch_12nkxos71u6lkttpyytfwi2bdq9yen1j7jplhocn96-0-export-format-csv-gid-797752596.csv @@ -0,0 +1,16 @@ +HR.info ID,Preferred Term,Scope,Date Added (dd/mm/yyyy),Date updated (dd/mm/yyyy),RW API ID,RW Alt Term,Match type - RW term is: +#org +type +code +v_hrinfo,#org +type +preferred,#description +definition,#date +created,#date +updated,#org +type +code +v_reliefweb,#org +type +v_reliefweb,#meta +match +431,Academic / Research,"Includes universities, colleges, think tanks, private organizations focusing on research and analysis",16/03/2017,,270,Academic and Research Institution,Exact Match +433,Donor,"Organizations responsible for donating money, goods or other in-kind contributions. ",16/03/2017,,,, +434,Embassy,Includes embassies as a distinct category of government organisations - the official residence or offices of an ambassador.,16/03/2017,,271,Government,Broader +435,Government,"Includes national and local government agencies, including development, emergency, civil protection, etc. Embassies are a separate category.",16/03/2017,,271,Government,Broader +437,International NGO,"Includes international organizations that operate independently from any government, including civil society. UN and ICRC/IFRC are in separate categories.",16/03/2017,,274,Non-governmental Organization,Broader +438,International Organization,"Includes intergovernmental organizations, funds and programmes. UN and ICRC/IFRC are in separate categories.",16/03/2017,,272,International Organization,Broader +439,Media,"Includes local, national and international print, TV, online and radio media agencies",16/03/2017,,273,Media,Exact Match +440,Military,Includes National and International military and military-related organisations,16/03/2017,,,, +441,National NGO,"Includes national and subnational organizations that operate independently from any government, including civil society. Red Cross/Red Crescent Societies are in a separate category.",16/03/2017,,274,Non-governmental Organization,Broader +443,Other,Includes all organizations that are not applicable to other organization types,16/03/2017,,275,Other,Broader +444,Private sector,"Includes private sector organizations such as corporate charity arms or foundations, for-profit recruitment firms and consultancies",16/03/2017,,,, +445,Red Cross / Red Crescent,"Includes IFRC, ICRC and national Red Cross/Crescent societies",16/03/2017,,276,Red Cross/Red Crescent Movement,Exact Match +446,Religious,Includes faith-based organizations and organizations with affiliations to religious bodies,16/03/2017,,,, +447,United Nations,"Includes all UN agencies, funds and programmes",16/03/2017,,272,International Organization,Broader diff --git a/tests/fixtures/input/food_security_ch_1sxsircxhxmzce0pwafcht-whjbdi9uqoefesubilgc4-export-format-csv-gid-2037574879.csv b/tests/fixtures/input/food_security_ch_1sxsircxhxmzce0pwafcht-whjbdi9uqoefesubilgc4-export-format-csv-gid-2037574879.csv new file mode 100644 index 00000000..32168c16 --- /dev/null +++ b/tests/fixtures/input/food_security_ch_1sxsircxhxmzce0pwafcht-whjbdi9uqoefesubilgc4-export-format-csv-gid-2037574879.csv @@ -0,0 +1,17 @@ +HRinfo ID,Preferred Term,Preferred Term (fr),ACRONYM,Group Type,Homepage,Date Created (Post Date),Updated date,Notes +#sector +code +v_hrinfo_sector,#sector +name +preferred +i_en,#sector +name +preferred +i_fr,#sector +code +acronym,#sector +type,#meta +url,#date +created,#date +updated,#meta +comment +4,Emergency Shelter and NFI,Abris d'urgence et NFI,SHL,Cluster,https://www.sheltercluster.org/,03/16/2017,4/4/2018,"Added French name; shelter cluster uses ""NFI"" in French as well" +1,Camp Coordination / Management,Coordination et gestion des camps,CCM,Cluster,http://www.globalcccmcluster.org,03/16/2017,4/4/2018,Added French name +5406,Mine Action,Action contre les mines,PRO-MIN,Area of Responsibility (Sub-cluster),http://www.globalprotectioncluster.org/en/areas-of-responsibility/mine-action.html,03/16/2017,4/4/2018,Added French name +6,Food Security,Sécurité alimentaire,FSC,Cluster,http://foodsecuritycluster.net/,03/16/2017,4/4/2018,Added French name +11,Water Sanitation Hygiene,"Eau, assainissement et hygiène",WSH,Cluster,http://washcluster.net/,03/16/2017,4/4/2018,Added French name +8,Logistics,Logistique,LOG,Cluster,http://www.logcluster.org/,03/16/2017,4/4/2018,Added French name +5403,Child Protection,Protection de l'enfance,PRO-CPN,Area of Responsibility (Sub-cluster),http://cpwg.net/,03/16/2017,4/5/2018,Updated French name based feedback from OCHA-FIS +10,Protection,Protection,PRO,Cluster,http://www.globalprotectioncluster.org/,03/16/2017,4/4/2018,Added French name +3,Education,Education,EDU,Cluster,http://educationcluster.net/,03/16/2017,4/4/2018,Added French name +9,Nutrition,Nutrition,NUT,Cluster,http://nutritioncluster.net/,03/16/2017,4/4/2018,Added French name +7,Health,Santé,HEA,Cluster,http://www.who.int/health-cluster/en/,03/16/2017,4/4/2018,Added French name +2,Early Recovery,Relèvement rapide,ERY,Cluster,http://earlyrecovery.global/,03/16/2017,4/4/2018,Added French name +5,Emergency Telecommunications,Télécommunications d'urgence,TEL,Cluster,https://www.etcluster.org/,03/16/2017,4/4/2018,Added French name +5404,Gender Based Violence,Violences basées sur le genre,PRO-GBV,Area of Responsibility (Sub-cluster),http://gbvaor.net/,03/16/2017,4/5/2018,Updated French name based feedback from OCHA-FIS +5405,"Housing, Land and Property","Logement, terre, et biens",PRO-HLP,Area of Responsibility (Sub-cluster),http://www.globalprotectioncluster.org/en/areas-of-responsibility/housing-land-and-property.html,03/16/2017,4/4/2018,Added French name from 2012 Côte d'Ivoire workshop report diff --git a/tests/test_main.py b/tests/test_main.py index 0de30443..6dda3c6e 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -100,9 +100,9 @@ def test_pipelines(self, configuration, folder): count = session.scalar(select(func.count(DBAdmin2.id))) assert count == 1312 count = session.scalar(select(func.count(DBDataset.id))) - assert count == 6 + assert count == 7 count = session.scalar(select(func.count(DBResource.id))) - assert count == 11 + assert count == 12 count = session.scalar(select(func.count(DBOrgType.code))) assert count == 14 count = session.scalar(select(func.count(DBSector.code)))