Skip to content

Commit

Permalink
create test for match_department
Browse files Browse the repository at this point in the history
  • Loading branch information
edulauer authored and augusto-herrmann committed Feb 21, 2024
1 parent 013734d commit e1104f9
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/searchers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,35 @@ def test_is_signature(dou_searcher, search_term, abstract):
def test_really_matched(dou_searcher, search_term, abstract):
assert dou_searcher._really_matched(search_term, abstract)

def test_match_department(dou_searcher):
department = ['Ministério da Defesa']
results = [
{
"section": "Seção 3",
"title": "EXTRATO DE COMPROMISSO",
"href": "https://www.in.gov.br/web/dou/-/extrato-de-compromisso-342504508",
"abstract": "ALESSANDRO GLAUCO DOS ANJOS DE VASCONCELOS - Secretário-Executivo Adjunto...",
"date": "02/09/2021",
"hierarchyList": ["Ministério da Defesa",
"Comando do Exército",
"Comando Militar do Nordeste",
"6ª Região Militar",
"28º Batalhão de Caçadores"],
},
{
"section": "Seção 3",
"title": "EXTRATO DE COMPROMISSO",
"href": "https://www.in.gov.br/web/dou/-/extrato-de-compromisso-342504508",
"abstract": "ALESSANDRO GLAUCO DOS ANJOS DE VASCONCELOS - Secretário-Executivo Adjunto...",
"date": "02/09/2021",
"hierarchyList": ["Ministério dos Povos Indígenas"],
}
]
dou_searcher._match_department(results, department)
assert len(results) == 1



@pytest.mark.parametrize(
'pre_term_list, casted_term_list',
[
Expand Down

0 comments on commit e1104f9

Please sign in to comment.