Beispiel #1
0
 def test_parameter_count(self):
     kw = Keyword.from_spec('myfunc:1,5t')
     assert kw.function == 'myfunc'
     assert kw.msgid_param == 1
     assert kw.msgid_plural_param is None
     assert kw.required_arguments == 5
Beispiel #2
0
 def test_domain_param(self):
     kw = Keyword.from_spec('dgettext:1d,2')
     assert kw.function == 'dgettext'
     assert kw.msgid_param == 2
     assert kw.msgid_plural_param is None
     assert kw.domain_param == 1
Beispiel #3
0
 def test_custom_msgid_param(self):
     kw = Keyword.from_spec('i18n_log:2')
     assert kw.function == 'i18n_log'
     assert kw.msgid_param == 2
     assert kw.msgid_plural_param is None
Beispiel #4
0
 def test_plural(self):
     kw = Keyword.from_spec('ngettext:1,2')
     assert kw.function == 'ngettext'
     assert kw.msgid_param == 1
     assert kw.msgid_plural_param == 2
Beispiel #5
0
 def test_minimal(self):
     kw = Keyword.from_spec('gettext')
     assert kw.function == 'gettext'
     assert kw.msgid_param == 1
     assert kw.msgid_plural_param is None