Formatting, docstrings and other chores.

This commit is contained in:
pablo 2021-01-04 22:17:40 +01:00
parent adf2cd26ba
commit cbf1643fb5
3 changed files with 32 additions and 255 deletions

View file

@ -2518,8 +2518,8 @@ def test_referencia_instructions_extract_correctly(real_ad_html):
referencia_instructions.validate()
assert (
referencia_instructions.found == True
and referencia_instructions.valid == True
referencia_instructions.found is True
and referencia_instructions.valid is True
and referencia_instructions.value is not None
and referencia_instructions.search_issue is None
)
@ -2534,7 +2534,7 @@ def test_referencia_instructions_find_nothing_in_unrelated_html(unrelated_html):
referencia_instructions.validate()
assert (
referencia_instructions.found == False
referencia_instructions.found is False
and referencia_instructions.valid is None
and referencia_instructions.value is None
and referencia_instructions.search_issue is not None
@ -2580,8 +2580,8 @@ def test_all_instructions_extract_correctly(real_ad_html):
assert all(
[
instruction.found == True
and instruction.valid == True
instruction.found is True
and instruction.valid is True
and instruction.value is not None
and instruction.search_issue is None
for instruction in all_instructions
@ -2628,8 +2628,8 @@ def test_all_instructions_fail_on_unrelated_html(unrelated_html):
assert all(
[
instruction.found == False
and (instruction.valid == False or instruction.valid == None)
instruction.found is False
and (instruction.valid is False or instruction.valid is None)
and instruction.value is None
for instruction in all_instructions
]
@ -2725,7 +2725,7 @@ def test_parsing_flow_fails_for_unrelated_html(unrelated_html):
assert not parsing_flow.all_non_optional_fields_were_found and len(
parsing_flow.issues
) == len(all_instructions)
) == len([field for field in all_instructions if not field.is_optional])
def test_parsing_flow_generator_returns_proper_flows():