File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 11import OMPython
2+ import pytest
23
34
5+ @pytest .mark .skip (reason = "This test would fail (no docker on github)" )
46def test_OMCPath_docker ():
57 omcp = OMPython .OMCProcessDocker (docker = "openmodelica/openmodelica:v1.25.0-minimal" )
68 om = OMPython .OMCSessionZMQ (omc_process = omcp )
@@ -21,6 +23,23 @@ def test_OMCPath_docker():
2123 del om
2224
2325
26+ def test_OMCPath_local ():
27+ om = OMPython .OMCSessionZMQ ()
28+
29+ p1 = om .omcpath ('/tmp' )
30+ assert str (p1 ) == "/tmp"
31+ p2 = p1 / 'test.txt'
32+ assert str (p2 ) == "/tmp/test.txt"
33+ assert p2 .write_text ('test' )
34+ assert p2 .read_text () == "test"
35+ assert p2 .is_file ()
36+ assert p2 .parent .is_dir ()
37+ assert p2 .unlink ()
38+ assert p2 .is_file () is False
39+
40+ del om
41+
42+
2443if __name__ == '__main__' :
2544 test_OMCPath_docker ()
2645 print ('DONE' )
You can’t perform that action at this time.
0 commit comments