Skip to content

Commit a375e5f

Browse files
committed
[test_OMCPath] add test_OMCPath_write_file
test escape of double quotes and backslash in OMCPath.write_text() / .read_text()
1 parent c3918c1 commit a375e5f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_OMCPath.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,17 @@ def _run_OMCPath_checks(om: OMPython.OMCSessionZMQ):
7676
assert p3.parent.is_dir()
7777
p3.unlink()
7878
assert p3.is_file() is False
79+
80+
81+
def test_OMCPath_write_file(tmpdir):
82+
om = OMPython.OMCSessionZMQ()
83+
84+
data = "abc # \\t # \" # \\n # xyz"
85+
86+
p1 = om.omcpath_tempdir()
87+
p2 = p1 / 'test.txt'
88+
p2.write_text(data=data)
89+
90+
assert data == p2.read_text()
91+
92+
del om

0 commit comments

Comments
 (0)