diff --git a/tests/parse/test_bool.py b/tests/parse/test_bool.py index 8717e00..7b5e7b8 100644 --- a/tests/parse/test_bool.py +++ b/tests/parse/test_bool.py @@ -40,6 +40,7 @@ # We expect the following behaviour: # - Error if the token is not True or False # - Have ParseError.NOT_BOOL as the exception code +# - Have ParseTask.PARSE_BOOL as the context's parse task @template_parse_invalid(Parser().parse_bool) def test_parse_bool_invalid_incorrect(draw, parent_context): token = draw(draw_token_not_bool()) @@ -52,6 +53,7 @@ # We expect the following behaviour: # - Error if there isn't a token # - Have ParseError.NO_TOKEN as the exception code +# - Have ParseTask.PARSE_BOOL as the context's parse task @template_parse_invalid(Parser().parse_bool) def test_parse_bool_invalid_empty(draw, parent_context): context = ParseContext(ParseTask.PARSE_BOOL, None, parent_context) diff --git a/tests/parse/test_clear_notes.py b/tests/parse/test_clear_notes.py index 2049018..8c6811a 100644 --- a/tests/parse/test_clear_notes.py +++ b/tests/parse/test_clear_notes.py @@ -84,6 +84,7 @@ # We expect the following behaviour: # - When a StartNote token is encountered skip_note is called to skip the note # - Any error skip_note gives is propagated through clear_notes +# - Have ParseTask.CLEAR_NOTES as the context's parse task @template_parse_invalid(NoteSkipperMockInvalid().clear_notes) def test_parse_clear_notes_startnote_propagation(draw, parent_context): return error_on_token(draw, parent_context, "StartNote", ParseError.TEST_ERROR) @@ -92,6 +93,7 @@ # Tests clear_notes errors when finding an EndNote # We expect the following behaviour: # - When an EndNote token is encountered a FOUND_ENDNOTE error is raised +# - Have ParseTask.CLEAR_NOTES as the context's parse task @template_parse_invalid(NoteSkipperMockValid().clear_notes) def test_parse_clear_notes_invalid_endnote(draw, parent_context): return error_on_token(draw, parent_context, "EndNote", ParseError.FOUND_ENDNOTE) diff --git a/tests/parse/test_note.py b/tests/parse/test_note.py index 6f0e0d1..5a7b46b 100644 --- a/tests/parse/test_note.py +++ b/tests/parse/test_note.py @@ -64,6 +64,7 @@ # We expect the following behaviour: # - Error if StartNote's token value is not "StartNote" # - Have ParseError.WRONG_TOKEN as the exception code +# - Have ParseTask.PARSE_NOTE as the context's parse task @template_parse_invalid(NoteSkipper().skip_note) def test_parse_note_invalid_nostartnote(draw, parent_context): (tokens, _) = draw(draw_token_note_valid()) @@ -78,6 +79,7 @@ # We expect the following behaviour: # - Error if there is no StartNote token at all # - Have ParseError.NO_TOKEN as the exception code +# - Have ParseTask.PARSE_NOTE as the context's parse task @template_parse_invalid(NoteSkipper().skip_note) def test_parse_note_invalid_empty(draw, parent_context): context = ParseContext(ParseTask.PARSE_NOTE, None, parent_context) @@ -88,6 +90,7 @@ # Tests parsing a note with a StartNote token in it # We expect the following behaviour: # - Error if a StartNote token is in the note content +# - Have ParseTask.PARSE_NOTE as the context's parse task @template_parse_invalid(NoteSkipper().skip_note) def test_parse_note_invalid_extrastartnote(draw, parent_context): (tokens, _) = draw(draw_token_note_valid()) @@ -102,6 +105,7 @@ # We expect the following behaviour: # - Error if there is no EndNote token at all # - Have ParseError.NO_TOKEN as the exception code +# - Have ParseTask.PARSE_NOTE as the context's parse task @template_parse_invalid(NoteSkipper().skip_note) def test_parse_note_invalid_noendnote(draw, parent_context): (tokens, _) = draw(draw_token_note_valid()) diff --git a/tests/parse/test_reference.py b/tests/parse/test_reference.py index 89bbe13..f7d13d0 100644 --- a/tests/parse/test_reference.py +++ b/tests/parse/test_reference.py @@ -29,6 +29,7 @@ # We expect the following behaviour: # - Error if a keyword or literal is encountered # - Have ParseError.RESERVED_NAME as the exception code +# - Have ParseTask.PARSE_REFERENCE as the context's parse task @template_parse_invalid(Parser().parse_reference) def test_parse_reference_invalid_name(draw, parent_context): token = draw(draw_token_known()) @@ -41,6 +42,7 @@ # We expect the following behaviour: # - Error if there isn't a token # - Have ParseError.NO_TOKEN as the exception code +# - Have ParseTask.PARSE_REFERENCE as the context's parse task @template_parse_invalid(Parser().parse_reference) def test_parse_reference_invalid_empty(draw, parent_context): context = ParseContext(ParseTask.PARSE_REFERENCE, None, parent_context) diff --git a/tests/parse/test_text.py b/tests/parse/test_text.py index 24c9e4b..abe991e 100644 --- a/tests/parse/test_text.py +++ b/tests/parse/test_text.py @@ -71,6 +71,7 @@ # We expect the following behaviour: # - Error if StartText's token value is not "StartText" # - Have ParseError.PARSE_TEXT as the exception code +# - Have ParseTask.PARSE_TEXT as the context's parse task @template_parse_invalid(Parser().parse_text) def test_parse_text_invalid_nostarttext(draw, parent_context): (tokens, _) = draw(draw_token_text_valid()) @@ -85,6 +86,7 @@ # We expect the following behaviour: # - Error if there is no StartText token at all # - Have ParseError.NO_TOKEN as the exception code +# - Have ParseTask.PARSE_TEXT as the context's parse task @template_parse_invalid(Parser().parse_text) def test_parse_text_invalid_empty(draw, parent_context): context = ParseContext(ParseTask.PARSE_TEXT, None, parent_context) @@ -96,6 +98,7 @@ # We expect the following behaviour: # - Error if a StartText token is in the text content # - Have ParseError.FOUND_STARTTEXT as the exception code +# - Have ParseTask.PARSE_TEXT as the context's parse task @template_parse_invalid(Parser().parse_text) def test_parse_text_invalid_extrastarttext(draw, parent_context): (tokens, _) = draw(draw_token_text_valid()) @@ -110,6 +113,7 @@ # We expect the following behaviour: # - Error if there is no EndText token at all # - Have ParseError.NO_TOKEN as the exception code +# - Have ParseTask.PARSE_TEXT as the context's parse task @template_parse_invalid(Parser().parse_text) def test_parse_text_invalid_noendtext(draw, parent_context): (tokens, _) = draw(draw_token_text_valid()) diff --git a/tests/parse/test_value.py b/tests/parse/test_value.py index 58dab06..1edda58 100644 --- a/tests/parse/test_value.py +++ b/tests/parse/test_value.py @@ -108,6 +108,7 @@ # We expect the following behaviour: # - Error if a keyword is encountered # - Have ParseError.RESERVED_NAME as the exception code +# - Have ParseTask.PARSE_VALUE as the context's parse task @template_parse_invalid(Parser().parse_value) def test_parse_value_invalid_name(draw, parent_context): token = draw(draw_token_keyword()) @@ -120,6 +121,7 @@ # Tests parsing empty value # We expect the following behaviour: # - Have ParseError.NO_TOKEN as the exception code +# - Have ParseTask.PARSE_VALUE as the context's parse task @template_parse_invalid(Parser().parse_value) def test_parse_value_invalid_empty(draw, parent_context): context = ParseContext(ParseTask.PARSE_VALUE, None, parent_context) @@ -130,6 +132,7 @@ # Tests parse_value error propagation # We expect the following behaviour: # - Errors from parsing are propagated and have the correct context +# - Have ParseTask.PARSE_VALUE as the context's parse task @template_parse_invalid(ParserValueMockError().parse_value) def test_parse_value_error_propagation(draw, parent_context): (tokens, action) = draw(draw_token_value_valid())