File: test_write.py

package info (click to toggle)
python-tomlkit 0.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,296 kB
  • sloc: python: 3,280; sh: 5; makefile: 4
file content (14 lines) | stat: -rw-r--r-- 282 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from __future__ import unicode_literals

from tomlkit import dumps
from tomlkit import loads


def test_write_backslash():
    d = {"foo": "\e\u25E6\r"}

    expected = """foo = "\\\\e\u25E6\\r"
"""

    assert expected == dumps(d)
    assert loads(dumps(d))["foo"] == "\e\u25E6\r"