Skip to content

Commit

Permalink
Make sure all standard Language classes have name (i.e. docstring)
Browse files Browse the repository at this point in the history
Fixes #4436.
  • Loading branch information
pekkaklarck committed Aug 17, 2022
1 parent 545c48d commit edcf6e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/robot/conf/languages.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ def settings(self):


class En(Language):
"""English"""
setting_headers = {'Settings', 'Setting'}
variable_headers = {'Variables', 'Variable'}
test_case_headers = {'Test Cases', 'Test Case'}
Expand Down
5 changes: 5 additions & 0 deletions utest/api/test_languages.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class X(Language):
X.__doc__ = None
assert_equal(X().name, '')

def test_all_standard_languages_have_code_and_name(self):
for cls in Language.__subclasses__():
lang = cls()
assert lang.code
assert lang.name

class TestFromName(unittest.TestCase):

Expand Down

0 comments on commit edcf6e7

Please sign in to comment.