Skip to content

Commit 8e86419

Browse files
committed
[test_OMCPath] define test using OMCSessionZMQ() locally
1 parent fcc8fe9 commit 8e86419

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

tests/test_OMCPath.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import OMPython
22

33

4+
@pytest.mark.skip(reason="This test would fail (no docker on github)")
45
def test_OMCPath_docker():
56
omcp = OMPython.OMCProcessDocker(docker="openmodelica/openmodelica:v1.25.0-minimal")
67
om = OMPython.OMCSessionZMQ(omc_process=omcp)
@@ -21,6 +22,24 @@ def test_OMCPath_docker():
2122
del om
2223

2324

25+
def test_OMCPath_local():
26+
om = OMPython.OMCSessionZMQ()
27+
28+
p1 = om.omcpath('/tmp')
29+
assert str(p1) == "/tmp"
30+
p2 = p1 / 'test.txt'
31+
assert str(p2) == "/tmp/test.txt"
32+
assert p2.write_text('test')
33+
assert p2.read_text() == "test"
34+
assert p2.is_file()
35+
assert p2.parent.is_dir()
36+
assert p2.unlink()
37+
assert p2.is_file() is False
38+
39+
del omcp
40+
del om
41+
42+
2443
if __name__ == '__main__':
2544
test_OMCPath_docker()
2645
print('DONE')

0 commit comments

Comments
 (0)