MCPcopy Create free account
hub / github.com/apache/impala / test_invalid_section

Method test_invalid_section

tests/unittests/test_file_parser.py:75–90  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

73 assert results[0] == expected_results
74
75 def test_invalid_section(self):
76 # Restrict valid sections to exclude one of the section names.
77 valid_sections = ['QUERY', 'RESULTS']
78 results = parse_test_file_text(test_text, valid_sections, skip_unknown_sections=True)
79 assert len(results) == 3
80 expected_results = {'QUERY': '# comment\nSELECT blah from Foo\ns\n',
81 'RESULTS': "'Hi'\n"}
82 assert results[0] == expected_results
83
84 # In this case, instead of ignoring the invalid section we should get an error
85 try:
86 results = parse_test_file_text(test_text, valid_sections,
87 skip_unknown_sections=False)
88 assert 0, 'Expected error due to invalid section'
89 except RuntimeError as re:
90 assert str(re) == "Unknown subsection: TYPES"
91
92 def test_parse_query_name(self):
93 results = parse_test_file_text(test_text, VALID_SECTIONS, False)

Callers

nothing calls this directly

Calls 1

parse_test_file_textFunction · 0.90

Tested by

no test coverage detected