19 from .settings
import (InitFileSettings, TestCaseFileSettings, ResourceFileSettings,
20 TestCaseSettings, KeywordSettings)
21 from .tokens
import Token
32 self.
languageslanguages = settings.languages
70 statement[0].set_error(message, fatal)
71 for token
in statement[1:]:
72 token.type = Token.COMMENT
75 raise NotImplementedError
78 marker = statement[0].value
79 return (marker[:1] ==
'*' and
87 settings_class = TestCaseFileSettings
99 return (f
"Unrecognized section header '{header}'. Valid sections: "
100 f
"'Settings', 'Variables', 'Test Cases', 'Tasks', 'Keywords' "
101 f
"and 'Comments'."),
False
105 settings_class = ResourceFileSettings
109 if self.
languageslanguages.headers.get(name)
in (
'Test Cases',
'Tasks'):
110 message = f
"Resource file with '{name}' section is invalid."
113 message = (f
"Unrecognized section header '{header}'. Valid sections: "
114 f
"'Settings', 'Variables', 'Keywords' and 'Comments'.")
116 return message, fatal
120 settings_class = InitFileSettings
124 if self.
languageslanguages.headers.get(name)
in (
'Test Cases',
'Tasks'):
125 message = f
"'{name}' section is not allowed in suite initialization file."
127 message = (f
"Unrecognized section header '{header}'. Valid sections: "
128 f
"'Settings', 'Variables', 'Keywords' and 'Comments'.")
129 return message,
False
135 template_set = property
138 return self.
settingssettings.template_set
144 template_set = property
Keeps a list of languages and unifies the translations in the properties.
def _normalize(self, marker)
def add_language(self, lang)
def keyword_context(self)
def __init__(self, settings=None, lang=None)
def variable_section(self, statement)
def task_section(self, statement)
def test_case_section(self, statement)
def comment_section(self, statement)
def _handles_section(self, statement, header)
def _get_invalid_section_error(self, header)
def keyword_section(self, statement)
def setting_section(self, statement)
def lex_invalid_section(self, statement)
def _get_invalid_section_error(self, header)
def lex_setting(self, statement)
def __init__(self, settings=None, lang=None)
def _get_invalid_section_error(self, header)
def test_case_context(self)
def test_case_section(self, statement)
def _get_invalid_section_error(self, header)
def task_section(self, statement)
def normalize_whitespace(string)