"""
territory = str(territory).upper()
- allowed_stati = set(("official",))
+ allowed_stati = {"official"}
if regional:
allowed_stati.add("official_regional")
if de_facto:
buf.append('%s: %s' % (name, value))
flags = set()
if self.fuzzy:
- flags |= set(['fuzzy'])
+ flags |= {'fuzzy'}
yield Message(u'', '\n'.join(buf), flags=flags)
for key in self._messages:
yield self._messages[key]
message.string = message.string[0]
message.flags |= oldmsg.flags
if fuzzy:
- message.flags |= set([u'fuzzy'])
+ message.flags |= {u'fuzzy'}
self[message.id] = message
for message in template:
#: list of format chars that are compatible to each other
_string_format_compatibilities = [
- set(['i', 'd', 'u']),
- set(['x', 'X']),
- set(['f', 'F', 'g', 'G'])
+ {'i', 'd', 'u'},
+ {'x', 'X'},
+ {'f', 'F', 'g', 'G'}
]
"""
rule = PluralRule.parse(rule)
- used_tags = rule.tags | set([_fallback_tag])
+ used_tags = rule.tags | {_fallback_tag}
_compile = _GettextCompiler().compile
_get_index = [tag for tag in _plural_tags if tag in used_tags].index
"extract -F babel-django.cfg --add-comments Translators: -o django232.pot %s ." % kwarg_text
)
assert isinstance(cmdinst, extract_messages)
- assert set(cmdinst.keywords.keys()) == set((
- '_',
- 'dgettext',
- 'dngettext',
- 'gettext',
- 'gettext_lazy',
- 'gettext_noop',
- 'N_',
- 'ngettext',
- 'ngettext_lazy',
- 'npgettext',
- 'npgettext_lazy',
- 'pgettext',
- 'pgettext_lazy',
- 'ugettext',
- 'ugettext_lazy',
- 'ugettext_noop',
- 'ungettext',
- 'ungettext_lazy',
- ))
+ assert set(cmdinst.keywords.keys()) == {'_', 'dgettext', 'dngettext',
+ 'gettext', 'gettext_lazy',
+ 'gettext_noop', 'N_', 'ngettext',
+ 'ngettext_lazy', 'npgettext',
+ 'npgettext_lazy', 'pgettext',
+ 'pgettext_lazy', 'ugettext',
+ 'ugettext_lazy', 'ugettext_noop',
+ 'ungettext', 'ungettext_lazy'}
@pytest.mark.parametrize("kwarg,expected", [
assert set(cmdinst.keywords.keys()) == set(expected)
# Test the comma-separated comment argument while we're at it:
- assert set(cmdinst.add_comments) == set(("Bar", "Foo"))
+ assert set(cmdinst.add_comments) == {"Bar", "Foo"}
def test_update_catalog_boolean_args():
def test_get_language_info():
- assert set(get_territory_language_info("HU").keys()) == set(("hu", "en", "de", "ro", "hr", "sk", "sl"))
+ assert set(get_territory_language_info("HU").keys()) == {"hu", "en", "de",
+ "ro", "hr", "sk",
+ "sl"}
list_currencies('yo!')
assert excinfo.value.args[0] == "expected only letters, got 'yo!'"
- assert list_currencies(locale='pa_Arab') == set(['PKR', 'INR', 'EUR'])
+ assert list_currencies(locale='pa_Arab') == {'PKR', 'INR', 'EUR'}
assert list_currencies(locale='kok') == set([])
assert len(list_currencies()) == 296
t2._catalog["bar"] = "quux"
t1.merge(t2)
assert t1.files == ["pro.mo"]
- assert set(t1._catalog.keys()) == set(('', 'foo', 'bar'))
+ assert set(t1._catalog.keys()) == {'', 'foo', 'bar'}