diff --git a/tests/parse/test_bool.py b/tests/parse/test_bool.py index 49ba67f..8717e00 100644 --- a/tests/parse/test_bool.py +++ b/tests/parse/test_bool.py @@ -39,6 +39,7 @@ # Tests parsing of invalid booleans # We expect the following behaviour: # - Error if the token is not True or False +# - Have ParseError.NOT_BOOL as the exception code @template_parse_invalid(Parser().parse_bool) def test_parse_bool_invalid_incorrect(draw, parent_context): token = draw(draw_token_not_bool()) @@ -50,6 +51,7 @@ # Tests parsing of empty tokens # We expect the following behaviour: # - Error if there isn't a token +# - Have ParseError.NO_TOKEN as the exception code @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_note.py b/tests/parse/test_note.py index 729d0a6..1411b46 100644 --- a/tests/parse/test_note.py +++ b/tests/parse/test_note.py @@ -63,6 +63,7 @@ # Tests parsing notes without StartNote # We expect the following behaviour: # - Error if StartNote's token value is not "StartNote" +# - Have ParseError.WRONG_TOKEN as the exception code @template_parse_invalid(NoteSkipper().skip_note) def test_parse_note_invalid_nostartnote(draw, parent_context): (tokens, _) = draw(draw_token_note_valid()) @@ -76,6 +77,7 @@ # Tests parsing empty notes # We expect the following behaviour: # - Error if there is no StartNote token at all +# - Have ParseError.NO_TOKEN as the exception code @template_parse_invalid(NoteSkipper().skip_note) def test_parse_note_invalid_empty(draw, parent_context): context = ParseContext(ParseTask.PARSE_NOTE, None, parent_context) @@ -99,6 +101,7 @@ # Tests parsing a note without an EndNote token # We expect the following behaviour: # - Error if there is no EndNote token at all +# - Have ParseError.NO_TOKEN as the exception code @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 b81d96d..0eb4651 100644 --- a/tests/parse/test_reference.py +++ b/tests/parse/test_reference.py @@ -28,6 +28,7 @@ # Tests parsing a reference with a reserved name errors # We expect the following behaviour: # - Error if a keyword or literal is encountered +# - Have ParseError.RESERVED_NAME as the exception code @template_parse_invalid(Parser().parse_reference) def test_parse_note_invalid_extrastartnote(draw, parent_context): token = draw(draw_token_known()) @@ -39,6 +40,7 @@ # Tests parsing of empty references # We expect the following behaviour: # - Error if there isn't a token +# - Have ParseError.NO_TOKEN as the exception code @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 0ce4c36..385e46b 100644 --- a/tests/parse/test_text.py +++ b/tests/parse/test_text.py @@ -70,6 +70,7 @@ # Test parsing text without StartText # We expect the following behaviour: # - Error if StartText's token value is not "StartText" +# - Have ParseError.PARSE_TEXT as the exception code @template_parse_invalid(Parser().parse_text) def test_parse_text_invalid_nostarttext(draw, parent_context): (tokens, _) = draw(draw_token_text_valid()) @@ -83,6 +84,7 @@ # Tests parsing empty text # We expect the following behaviour: # - Error if there is no StartText token at all +# - Have ParseError.NO_TOKEN as the exception code @template_parse_invalid(Parser().parse_text) def test_parse_text_invalid_empty(draw, parent_context): context = ParseContext(ParseTask.PARSE_TEXT, None, parent_context) @@ -93,6 +95,7 @@ # Tests parsing text with a StartText token in it # We expect the following behaviour: # - Error if a StartText token is in the text content +# - Have ParseError.FOUND_STARTTEXT as the exception code @template_parse_invalid(Parser().parse_text) def test_parse_text_invalid_extrastarttext(draw, parent_context): (tokens, _) = draw(draw_token_text_valid()) @@ -106,6 +109,7 @@ # Tests parsing text without an EndText token # We expect the following behaviour: # - Error if there is no EndText token at all +# - Have ParseError.NO_TOKEN as the exception code @template_parse_invalid(Parser().parse_text) def test_parse_text_invalid_noendtext(draw, parent_context): (tokens, _) = draw(draw_token_text_valid())