Exemplo n.º 1
0
    def test_ruby(self):
        data = '''en:
  language_name: English
  language_name_english: English
  message:
    unsubscribe: Unsubscribe from our emails
    from_app: from %{app_name}
'''
        store = yaml.RubyYAMLFile()
        store.parse(data)

        out = BytesIO()
        store.serialize(out)

        assert out.getvalue() == data.encode('ascii')
Exemplo n.º 2
0
    def test_ruby_list(self):
        data = '''en-US:
  date:
    formats:
      default: '%Y-%m-%d'
      short: '%b %d'
      long: '%B %d, %Y'
    day_names:
    - Sunday
    - Monday
    - Tuesday
    - Wednesday
    - Thursday
    - Friday
    - Saturday
'''
        store = yaml.RubyYAMLFile()
        store.parse(data)
        out = BytesIO()
        store.serialize(out)

        assert out.getvalue() == data.encode('ascii')